Read in some blog that GC in Android happens on main(UI) thread, this may create sluggishness in UI screen depending on the frequency of GC execution.
Hence I was wondering will it be a good idea if I manually release objects(by assigning null value) which has no further use for me.
This way we may avoid multiple execution of GC in the application.
Please share your thoughts.
Thanks,
sku
Releasing (dereferencing) objects for which you have no further use is always a good idea. You can also use
SoftReference,WeakReferenceand/orWeakHashMapto help the GC pick up stuff that you don’t mind going away if the system needs space.There’s more information about Android’s GC system here.