views:

80

answers:

2

I'm trying to compare memory utilization of an application running under Linux and Windows on the same PC. Is there a "quick and dirty" way to normalize readings from Windows task manager and Linux top utility?

+2  A: 

I would subtract startup memory usage from both values. Add a sleep of 10 seconds to the beginning of the application, and find out what values the systems report. Then subtract these values from later readings, and you get the amount of memory consumed by dynamic allocations.

Martin v. Löwis
+1  A: 

I don't know about Linux, but for Windows you will want to use "Private Bytes" for the application. This is called "VM Size" in Task Mananger (and "Virtual Memory Size" in the dialog to select it).

"Private Bytes" is the value that is directly related to memory allocations in your application. If you allocate 3 MB this value will actually go up by this much (perhaps except for some chunking, e.g. in a number of 64 KB blocks.)

Peter Mortensen