O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Resource leaks

If a proper lifecycle of the Activity isn't maintained, and if one doesn't take care of cleaning up resources, leaks will certainly happen. There are usually a few kinds of leaks

Memory Leaks will prevent the Garbage Collector (GC) from retrieving portions of unused memory and in the end, will cause the entire application to be killed because it ran out of available memory.

Thread (or Observable) leaks mean that there can be operations running in the background even though the parent Activity is closed and whatever result is returned doesn't matter anymore. This will also make it use CPU and thus drain the battery for no purpose.

Network responsiveness and bandwidth can be lost because a rogue Threads keeps an active connection ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required