www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: sushobhit on March 07, 2014, 07:07:02 am

Title: AlienRunner Memory Ques
Post by: sushobhit on March 07, 2014, 07:07:02 am
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
Title: Re: AlienRunner Memory Ques
Post by: EgonOlsen on March 07, 2014, 07:29:26 am
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.