Memory usage in a DLL.
Posted on 1998-08-04
I need some tips on tracking memory (and handle) usage in a DLL. Our system uses 100+ apps (mostly CGI's) that all share some common library code. I have just finished moving the library from a static lib into a dynamic lib, figuring that this should produce a major savings in memory and disk footprint.
Wrong! The size of most apps shrunk from ~700K to ~35K, but the memory usage when they are loaded jumps from ~800K to ~10Mb. They have also moved from two handles to 60+. When we are running 10-20 apps at a time, this is a fairly major amount of memory. (I don't think it will stand up to thousands of simultaneous users!)
I realize that in the DLL form, all of the globals need to be initialized, whereas in the lib, they could potentially be excluded from the link. I assume that this is what is going on here.
What I need to know is: Are there any utilities that will track the memory and resource (handle) usage for an app. I'm not too sure what the NT task manager is using to calculate the VM size and mem usage. I would love to know how much ram is used at the various points in the apps lives, and also what handles (how many of each type, etc) are being used by the app.)