bloody iPhone memory problem again(opengl es, texture2d)
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.
Thanks
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.
Thanks
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
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
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Texture2d crash lander | ajrs84 | 0 | 2,249 |
Apr 1, 2012 08:54 AM Last Post: ajrs84 |
|
| OpenGL Differences between iPhone Sim and Real iPhone | SparkyNZ | 5 | 5,564 |
Apr 13, 2011 11:40 AM Last Post: SparkyNZ |
|
| Line Smooth Problem on iPhone Device | abelix | 1 | 3,490 |
Sep 22, 2010 06:28 AM Last Post: Skorche |
|
| Problem using Texture2D sub-section | bendell | 0 | 2,086 |
Mar 20, 2010 02:06 AM Last Post: bendell |
|
| Create a texture2d with contents of other textures | godexsoft | 6 | 3,773 |
Nov 12, 2009 10:24 PM Last Post: godexsoft |
|

