Opengl and memory usage

Started by
5 comments, last by aewarnick 19 years ago
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?
*C++*->
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
Also, please don't use task manager to gauge your memory. It does far more behind the scenes and it's not very accurate.
Is there an accurate way to measure how much my app is using?
*C++*->
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,
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
Thank you.
*C++*->

This topic is closed to new replies.

Advertisement