AlienRunner Memory Ques

Started by sushobhit, March 07, 2014, 07:07:02 AM

Previous topic - Next topic

sushobhit

Hi Egon ,

Yesterday I downloaded AlienRunner source and was going through it in SurfaceCreated
there is piece of code something like this :
int[] memoryalloc = new int[1024*512*3];
memoryalloc[0] = 1; //use it
memoryalloc = null; // clean it
// 6 mb

Now as I can see here you are just creating 6 mb space in the memory(RAM) and then make that 6mb free
As memoryalloc is not used anywhere else then why are you doing this code.

Please help me understand and does it increase the efficency of APP

EgonOlsen

That dates back to Android 1.5, which had very bad garbage collection and memory allocation behaviour. That little trick helped the game to run more stable and with less hick-ups. It's pointless on current devices.