bloody iPhone memory problem again(opengl es, texture2d)

Posts: 7
Joined: 2009.03
Post: #1
Hi there,

my problem is:

I use Texture2d class to load textures from png images using this: bckg = [[Texture2D alloc] initWithImage: [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"largebackground" ofType:@"png"]]];

this is fine. when I release this texture, it's all fine. the memory is the same as it was before loading the texture. only problem is when I draw the texture. Instruments shows some more memory usage (it's actually few mb since I am using large 1024x1024 textures) then after releasing the texture some memory still remains there.

So my question are:
why there is memory usage when drawing the texture?
how cn I release the memory used when drawing?

I am not an expert in OpenGL|ES. And I am very interested in this because I need the same usage of memory after finishing a level so a new level can be load without iPhone crashing!

Please point me any direction, any ideas will be appreciated.

Quote this message in a reply
Posts: 4
Joined: 2009.04
Post: #2
My experience in memory reporting in Instruments is not to totally believe everything you see.

Take into consideration:

Instruments itself add a little overhead while running

Even though your release an object it does not mean the memory will be released immediately, it will be released at some appropriate time in the future or when more memory is needed

Hope this helps
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Texture2d crash lander ajrs84 0 4,021 Apr 1, 2012 08:54 AM
Last Post: ajrs84
  opengl es strange 16bit texture scale problem spuckfunkel 6 14,396 Aug 14, 2011 10:44 PM
Last Post: headkaze
  OpenGL Differences between iPhone Sim and Real iPhone SparkyNZ 5 10,016 Apr 13, 2011 11:40 AM
Last Post: SparkyNZ
  Line Smooth Problem on iPhone Device abelix 1 5,821 Sep 22, 2010 06:28 AM
Last Post: Skorche
  Problem using Texture2D sub-section bendell 0 3,592 Mar 20, 2010 02:06 AM
Last Post: bendell