How do check how much RAM your program uses?

Started by
8 comments, last by Jedyte 22 years, 7 months ago
This may be a simple question but... how do check how much RAM your program uses? I''m using DJGPP 2.03 under Windows 98, if that matters.. Tnx!
And the price we paid was the price men have always paid for achieving paradise in this life -- we went soft, we lost our edge. - "Muad'Dib: Conversations" by the Princess Irulan
Advertisement
please post your replies, guys; i would like to know that, too! iam using visual c++, directX 7.0 if that matters

woody
On the current project I''m working on, we wrote a Memory Manager which overrides mallocs. Basically under the hood, you can do heap management and diagnostics to get your.

If you need a something to go off of, check this out:

http://www.fluidstudios.com/publications.html

-JT
In Windows 2000, you run your program, and bring up task manager. That''ll give you a list of all processes running and the amount of memory being used. Under Win98, you might want to use Norton''s System Info (the one that comes with Windows sucks).

But if you do have to use the system info that comes with windows(under the start menu''s accessories->System Tools), look at the % of resources free before running your program, run your program and look at the % of free resources when your program is running. You should be able to calculate how much memory is being used.

Under Linux, I''ve no idea how.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
under linux just use your normal process manager to get the info
Keep in mind that neither NT''s task manager, or ''top'' in Linux, are always 100% accurate.

~~~~~~~~~~
Martee
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
quote:Original post by Anonymous Poster
under linux just use your normal process manager to get the info



Could you elaborate? How do I start the process manager? (Linux newbie here....)
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
''ps'' gives al processes, and their also something more elaborate under ''top'', if I remember correctly
And the price we paid was the price men have always paid for achieving paradise in this life -- we went soft, we lost our edge. - "Muad'Dib: Conversations" by the Princess Irulan
If you are using C++ you can do the following:

1. write a new operator for each of you classes, in where
you count the memory being allocated.
2. write custom allocators for whenever you use STL containers


No when you figure out how to do this, it should be easy for you
to sum all the memory allocated up somewhere.

This solution should prove to be portable,
and in case of win98, this might be the only way to get a precise result.

But if you think of it, it would perhaps be easier for you to install win2k/nt/xp and use the task manager provided there

Jonas Meyer Rasmussenmeyer@diku.dk
quote:Original post by ZubZorro
If you are using C++ you can do the following:

1. write a new operator for each of you classes, in where
you count the memory being allocated.
2. write custom allocators for whenever you use STL containers


No when you figure out how to do this, it should be easy for you
to sum all the memory allocated up somewhere.



I don''t think this is going to be too accurate as it only counts the memory that you''ve allocated. It doesn''t take into account stuff like DLLs, etc.

Thanks for the Linux tip, though. it is sure to be helpful
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.

This topic is closed to new replies.

Advertisement