views:

15

answers:

1

I would like to check how much RAM a program I am working on is using, and I was wondering what methods/programs are available that can do this? Is there an easy way to "predict" this? (ie, DLLs are loaded directly into RAM, right? Thus, the file sizes of the DLLs would indicate how much RAM they take up? Am I correct?)

Thanks!

A: 

Task Manager Mem Usage / VM Size columns give a fair indication of the amount of memory your application is consuming at a particular point in time. The Peak Mem Usage column gives you the metric you would expect - so could be useful as well.

The size of a DLL on disk is not a fair indication of how much memory that DLL will use once loaded - the code within the DLL is free to allocate memory dynamically as required, so e.g. a 5K DLL could allocate 32GB if it so desires!

Will A
Ah, of course! Thanks, I knew both of these things, but would it be correct to say that AT LEAST the full DLL is loaded into memory, so in the example above, at LEAST 5k of memory is taken up when the DLL is dynamically linked?
Russel
No problem, Russel. I certainly wouldn't bank on the memory usage for a particular DLL being _at least_ the size of the DLL - I'm sure there are situations where only part of the DLL is loaded into memory - however, it doesn't seem that bad to use this as an estimate of minimum memory usage.
Will A