memory - GC and java heap analysis in Android Studio -
i'm playing around in android studio learn more memory leaks.
what noticed that, after rotating screen couple of times, see multiple instances of activity (after clicking on "initiate gc" , "dump java heap").
but when click 2 times on "initiate gc", , click after on "dump java heap", see activity , inner classes have 1 instance.
why have click twice on "initiate gc" clear activity instances? leaking memory or not?
edit: noticed happens when creating new project blank activity. i'm not leaking memory, i'd still know why instances aren't destroyed on first gc
the "initiate gc" button signal gc run. when java gc runs, not guaranteed memory references can cleared, cleared @ gc run.
this trigger gc run. when gc runs has same behavior.
so have click multiple times "initiate gc" until verify object afraid leaking has been cleared gc.
there plenty info out there, example thread how force garbage collection in java?
Comments
Post a Comment