6Mb of memory taken up by glDrawElements

Member
Posts: 110
Joined: 2009.07
Post: #1
I have call the following function in my code.

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...

http://www.fluttermind.com
Fluttermind - Games for Everyone
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
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.
Quote this message in a reply
Member
Posts: 110
Joined: 2009.07
Post: #3
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.

http://www.fluttermind.com
Fluttermind - Games for Everyone
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  glDrawElements help wonza 6 4,926 Apr 18, 2009 08:44 AM
Last Post: AnotherJake