6Mb of memory taken up by glDrawElements
I have call the following function in my code.
This one line makes 6mb of difference to my memory footprint. It doesn't matter where I call it, nor how many times. It always takes 6Mb. This seems curious to me. Reading through the documentation, I can't find anything saying this function automatically creates a copy of your pre-allocated buffers in system memory. Anyone else found this?
FYI, I'm using the following code to find out where my memory is going:
The reason I'm using this is that since the 3.1 update I can't run my app on hardware directly from XCode, thus removing the possibility of using several Instruments. I'm trying to track that down, too...
Code:
glDrawElements(GL_TRIANGLES, VERTEX_INDICES_PER_SPRITE, GL_UNSIGNED_SHORT, myIndexArray);
This one line makes 6mb of difference to my memory footprint. It doesn't matter where I call it, nor how many times. It always takes 6Mb. This seems curious to me. Reading through the documentation, I can't find anything saying this function automatically creates a copy of your pre-allocated buffers in system memory. Anyone else found this?
FYI, I'm using the following code to find out where my memory is going:
Code:
int MemoryReport(void)
{
struct task_basic_info info;
mach_msg_type_number_t size = sizeof(info);
kern_return_t kerr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &size);
if( kerr == KERN_SUCCESS )
{
return(info.resident_size);
}
else
{
return(-1);
}
}
The reason I'm using this is that since the 3.1 update I can't run my app on hardware directly from XCode, thus removing the possibility of using several Instruments. I'm trying to track that down, too...
Which instruments work only when launched from XCode? I've never used XCode to connect Instruments or Shark to my application.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Wow... what a massive numpty I be. It never occurred to me to run Instruments outside of XCode. All this time I've assumed that everything but 'Shark' is an integral part of XCode. That helps a lot. :-)
[Edit] To add to my already impressive idiocy score, I found that this memory chunk issue only exists in the simulator.
[Edit] To add to my already impressive idiocy score, I found that this memory chunk issue only exists in the simulator.
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
glDrawElements help | wonza | 6 | 7,110 |
Apr 18, 2009 08:44 AM Last Post: AnotherJake |