Sign in to follow this  

Question on how to check memory footprint

This topic is 3576 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am currently working on multiple platforms and I wanted to see how much memory my code and information I am processing is taking up. Some developers asked that question at GDC and I want to have the answer if anyone else asks again. I've done some quick searching online but only came up with a PC solution of tracking a overall programs memory usage. Is there an API or something I am missing to insert in my code to track a specific set of functions/libraries? Any help, ideas, or thoughts will be greatly appreciated and feel free to email me directly. Thanks, Mark G. mgugler@thx.com

Share this post


Link to post
Share on other sites
What platforms are we talking about here?

I'd the number of allocated bytes by putting code around the OS memory allocation call (Depending on the platform, you may already have this for your own allocator code) and/or by overloading operators new and delete.

On the PC, new, malloc(), etc all go through the CRT allocators, so you could use the various CRT heap hooks and debug tools to determine this.

Share this post


Link to post
Share on other sites
I want to track it on the PC and the 3 major consoles. I currently don't use any memory allocations (since SPUs don't support it) so overloading those operators aren't feasible. I guess I am left with counting up the structures and variables I use?

Share this post


Link to post
Share on other sites
Well if you're writing your own engine you will certainly need some form of memory management system (not having one generally means 100% memory fragmentation after your app runs for a while; that means poor performance on long soaks). Once that's written you will have easy and direct access to that information because all memory allocation will go through your manager (which will be generally pre-allocated).

Otherwise, yeah, just overload new/delete and track memory usage.

-me

Share this post


Link to post
Share on other sites

This topic is 3576 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this