Startwatch Memory Monitoring

I am just playing with Startwatch at present. My question is why does Startwatch show my WD memory at 99.41MB when W2K Task Manager only shows it at abot 45Mb (48Mb peak). I did not think I needed the memory leak test limit anywhere near that high. The other two programs I’m monitoring at present dont show memory usage higher than task managers peak useage.

Stuart

There are different ways to display a program’s memory use. The main reason for this is Window’s virtual memory feature. Virtual memory is a way to pretend a computer has much more memory than it actually has. When a program is running, all the memory it uses for the program code and data is mapped in a virtual memory space. As the program accesses that code and data, the virtual memory is mapped into the actual memory.

TaskManager and many other programs display what is called “the working set”. That is the amount of a program’s virtual memory that is currently mapped into actual memory. StartWatch displays the “pagefile usage”. That is the actual amount of memory a program has allocated. The working set is a transient value. If you were running a program that allocated 100MB of memory, and there were no other programs running, Windows might map all that virtual memory into actual memory. But if you had 1GB of ram, and you were running 20 copies of that program, each instance of the program would have a working set that was only a fraction of the 100MB it had allocated.

Another example is how the memory use for a program as shown in TaskManager will go down if you minimize the program. In reality, the program still has the same amount of memory allocated. But Windows figures that since it’s minimized, it won’t be as active a program. So it just reduces the amount of the program’s allocated memory that is allowed into the actual memory. As the program continues running, every time it access a chunk of memory that is not in actual memory, windows will bring that chunk in, and you will see the program’s memory in TaskManager go up as that happens. The reason the value StartWatch displays is better for monitoring a program’s memory use is because when a program has a memory leak, the virtual memory number will get increasingly larger. But as that value gets very large, Windows will compensate by limiting how much of that memory is allowed in actual memory. So even though the program keeps requesting more and more memory, the working set value may stay somewhat static as Windows tries to keep a cap on the impact of the leaky program.

The value displayed by StartWatch is a better indicator of how much memory a program is using. The value displayed in TaskManager only shows how much of that memory Windows thinks the program needs to have access to at the moment, and that value is dependent on many factors such as how much memory is in your machine, how many programs are running, and how frequently a program is accessing the various chunks of its memory.

You can tell Task Manager to display the same value StartWatch displays by selecting View/Select Columns, and checking “Virtual Memory Size”. You can see in StartWatch the value TaskManager displays by right clicking the program in the main StartWatch Status window and selecting statistics. That will pop up a window that gives much more detail on the program’s memory use.

I hope this answers your question. I’m sorry that the answer is so technical, but it is a rather complicated Windows topic, and in reality is even more complicated than I have presented.

Thanks for the repoy, I do understand Windows (and other VM workings) I was just surprised that this much was display because even when I have traced WD I have never seen it use anywhere near that much all at once, for me its never been over about 60Mb so I set the memory limit at 65Mb initially. Since with a limit lower than the amount shown and the fact that Startwatch did not close and restart WD I presume that it actually looks at the working set for memory management.

Stuart