Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From http://code.google.com/p/libgdx/wiki/TheArchitecture:
- A recurring theme throughout libgdx is releasing or disposing of unneeded resources. Memory on mobile devices is precious and we always have to strive for minimizing our memory use be it system memory or video memory. We must therefore always dispose resources that are no longer needed. All graphical resources have a dispose() method which you should call once you no longer need the resource. Another reason for explicit memory management of resources is that some of them are not visible the the VM and are thus unlikely to be garbage collected. Pixmaps for example have their pixels stored in the native heap which is not managed by the garbage collector of the VM. All the garbage collector sees is a puny little class instance taking up a couple of bytes in the VM heap. The garbage collector might thus post-pone the collection of such an instance and we run out of native heap memory. The same is true for OpenGL ES resources that reside in video memory such as textures. The message to take away: always dispose of unneeded resources!
- ----------------------------------------------------
- Managed and unmanaged textures (OpenGL Context loss): http://www.badlogicgames.com/wordpress/?p=1073
Advertisement
Add Comment
Please, Sign In to add comment