Have a careful look at the source code for this game Replica Island:
http://code.google.com/p/replicaisland/

Specifically the all the Objects that extend:
http://code.google.com/p/replicaisland/source/browse/trunk/src/com/replica/replicaisland/AllocationGuard.java

When the game is running almost no dynamic objects are allocated, they are 
mostly pre-allocated and held on "free" lists and re-used.  This is to try 
and avoid a GC during a level which could seriously affect the feel of the 
game.  It also gives finer control of the amount of memory used in the game.

See also:
http://replicaisland.net/
http://replicaisland.blogspot.co.uk/


On Monday, November 12, 2012 10:10:36 PM UTC, iQue wrote:
>
> also, is there a preffered method to remove objects after using 
> arrayList.add()? should I just use arrayList.remove(index) when they die/ 
> bullets dissapear from screen?
>
> Den måndagen den 12:e november 2012 kl. 23:07:53 UTC+1 skrev iQue:
>>
>> Great tips, thank you!
>>
>> this line: "So make sure object references go out of scope or are 
>> otherwise removed the instant they 
>>  aren't needed."  how would I go about checking this? how do I find the 
>> object that is causing problems? Cus I do have arrayLists and use 
>> arrayList.add(enemy/bullet). So that might be the problem, had no idea that 
>> used alot of heap.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to