in Android Running time Android Monitor
will Show the Memory Usage. that Panel have a initiate Garbage Collection
Button while pressing that Button Memory will reduce. my question is programmatically initiate that Garbage initiation.Before CG and
After CG
Runtime.getRuntime().gc();
This line of code does not guarantee that garbage collector will be called. But it usually is as far as I can see.
And actually you don't need it. You should ensure you have no leaks and let GC work on it's own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With