: , . , , , , , . Unibus Garbage Collector, , , , .
. , , , , . , , . Context . .
There are solutions for this, besides the obvious ones (free objects, when you finish, etc.). In Java there SoftReferences, WeakReferencesand others. These objects are containers that tell the garbage collector that they prefer to be emptied after not using them or other links pointing to them. Therefore, you are helping the GC know what should be released. They are dangerous at some point in Android environments, because applications are limited to too 16 MB of heap, and therefore WeakReferencecan be built too quickly. You need to check if the object is saved.
source
share