I have created a new android Emulator based on Android 2.3.3 with 512MB RAM and 32/64/128/256/512 Heap Space.
But i still get the same problem all the time i try to install a package with adb install:
D/dalvikvm( 341): GC_CONCURRENT freed 429K, 41% free 3445K/5767K,
external 716K/1038K, paused 5ms+2ms
i get this twice per second and the emulator fed up all the system resources (CPU and RAM).
So is there a bug somewhere in the heap allocation? Or do i need to set the value to something extraordinary high like 65535? This Logoutput does only seems to start when i try to install a package.
Edit: i will specify it a little bit more clearer:
it doesnt matter what value i enter in the config.ini file for the vm.heapSize, in any case i get the same memory value of 5767K from the GC Message above.
So this is truly a bug of the emulator!
And again i didnt programmed anything, i just need my emulator up and running!
I think you are understanding things a little wrong — the
5767Kamount is the current size of the heap, not the maximum size of the heap which what you are changing.The Android GC is very aggressive — that is when a new object is created the GC will generally always prefer to clean up old objects to free space than to increase the heap size, which is the behaviour you are seeing here. No matter what size you set the maximum heap to you will not reach it doing what you are doing because in this case the GC is always able to free old memory instead, and so this is what it will do.
Try writing a program that keeps allocating
Bitmaps (and make sure you a keep a reference to all theBitmaps you create so the GC cannot collect them) and see how large your heap gets then.The GC on devices may be a little less aggressive but will probably be similarly tuned.