Jump to content
  • Advertisement
Sign in to follow this  
aewarnick

OpenGL Opengl and memory usage

This topic is 4949 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

According to my task manager, when I first start my opengl app the memory usage is through the roof: 19000k. After I minimise it and restore it again the usage goes down to below 3000k! Even when I make my app draw the images and graphics the memory usage stays at about 3000k. Why the 19000k when I first start the app and where did it go?

Share this post


Link to post
Share on other sites
Advertisement
When you first start the app, that is how much it is using. Once you minimize it though, Windows will incorrectly display the memory usage. That is why it says at 3MB - it is all still there though. As for why it starts out at 19MB depends on what you are doing in your code, you must have allocated that much. Does this make sense?

- Drew

Share this post


Link to post
Share on other sites
Also, please don't use task manager to gauge your memory. It does far more behind the scenes and it's not very accurate.

Share this post


Link to post
Share on other sites
You can roll your own which is a little tricky, or just find some library on the net. There are quite few, some free some charge. Good start are www.codeguru.com and www.codeproject.com. You should be able to find something there or enough info/links,

Share this post


Link to post
Share on other sites
Measuring memory usage of a program on a system which supports virtual memory is very difficult - your best bet is to instrument your C library etc, to count the amount of malloc(s), new(s) etc.

I feel sure from what I've seen that the Windows Task Manager is not a useful measure of anything, and seems more like a random number generator than an actual useful measurement.

The basic problem with memory on virtual-memory supporting systems, is that pages which are mapped might not correspond in a 1:1 fashion to memory actually being used - the same page can be used by several processes, and the same page can be mapped in at more than one address. Likewise, memory can be swapped out.

Mark

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!