While running, i get this in my android monitor, it keeps expanding with no ends :
09-02 14:01:36.150 25666-25671/... I/zygote: Do partial code cache collection, code=30KB, data=27KB
09-02 14:01:36.150 25666-25671/... I/zygote: After code cache collection, code=30KB, data=27KB
09-02 14:01:36.151 25666-25671/... I/zygote: Increasing code cache capacity to 128KB
09-02 14:01:39.064 25666-25671/... I/zygote: Do partial code cache collection, code=59KB, data=53KB
09-02 14:01:39.066 25666-25671/...r I/zygote: After code cache collection, code=59KB, data=53KB
09-02 14:01:39.066 25666-25671/... I/zygote: Increasing code cache capacity to 256KB
09-02 14:01:46.287 25666-25671/... I/zygote: Do full code cache collection, code=123KB, data=94KB
09-02 14:01:46.298 25666-25671/... I/zygote: After code cache collection, code=97KB, data=59KB
09-02 14:01:53.853 25666-25671/... I/zygote: Do partial code cache collection, code=122KB, data=90KB
09-02 14:01:53.853 25666-25671/... I/zygote: After code cache collection, code=122KB, data=90KB
09-02 14:01:53.853 25666-25671/... I/zygote: Increasing code cache capacity to 512KB
Here is the code :
CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));
for (int i = 0; i < IDs.size(); i++) {
InputStream inputStream = new URL("https://awebsite/" + IDs.get(i)).openStream();
inputStream.close();
}
Problem "fixed", it's working on an real device but not on an emulated one.
The answer can be found at the official documentations:
https://developer.android.com/topic/performance/memory-overview
The Android Runtime (ART) and Dalvik virtual machine use paging and memory-mapping (mapping) to manage memory. This means that any memory an app modifies—whether by allocating new objects or touching mapped pages—remains resident in RAM and cannot be paged out. The only way to release memory from an app is to release object references that the app holds, making the memory available to the garbage collector.
Garbage collection
A managed memory environment, like the ART or Dalvik virtual machine keeps track of each memory allocation.
In a virtual machine, it's happening but in a Physical device, the result is different. The Garbage collector cleans or needs to clean whatever is not in use anymore.
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