Windows Task Manager – what do the memory columns mean?
Category : Knowledge
I have recently been using Windows to tune a Java application I created to move large amounts of data into a database. The application was very memory hungry as it implemented various queues to buffer incoming data before committing it to the data target.
This meant that I needed to understand the memory which was being used at any given point, both in the JVM and on the operating system itself. On the Windows side, the Task Manager has many extra columns which can be added to the Processes tab to see exactly what each process is doing, and how much resource it is costing to do it.
The CPU and IO columns should be fairly straight forward however the memory columns can be most confusing. Before we can get into it there are a few terms which you must understand
- Physical memory – this is RAM, physical memory which you have installed in your machine. This is the fastest type of memory and also the most expensive. Physical memory will be used for all your processes memory requirements unless you run out or the operating systems decides to free some for other things.
- Virtual memory – when you run out of physical memory and another process asks for more memory the operating system needs a mechanism to ensure the requirements can be met. Virtual memory is used much the same as RAM however it is stored on a disk. Disks, even SSDs, are very slow compared to RAM and come with a huge performance impact. Your operating system will move RAM to virtual memory when a process hasn’t been used for a while, or if sacrifices need to be made to free some RAM for something else.
There are many memory related columns in Windows Task Manager which all have subtly different meanings. Here are some of the most common and useful memory column definitions:
- Memory – Working Set – is the total amount of memory used by the process which is private and unique to the process as well as shared memory used by the process such as shared libraries.
- Memory – Private Working Set – is the amount of memory used by the process which is unique to the process and cannot be accessed by other processes.
- Memory – Peak Working Set – is the most memory, both unique and shared, which has been used by the process since it started. This is reset each time the process ends.
- Memory – Commit Size – is the amount of virtual memory which is reserved, or committed, for the process.
- Page Faults – is the amount of times memory has been fetched from virtual memory because it was not found in physical memory. This is a counter and similar to Memory – Peak Working Set in that it is reset each time the process ends.
By understanding an monitoring these values you can get an understanding of what a processes is doing with it’s memory.
2 Comments
Kuldeep
3-Mar-2014 at 6:09 amIn my humble opinion this article must also explain that in the Task Manager we would not see a pattern of decreasing memory, which actually does not indicate some memory leak from our application, as mentioned here: http://stackoverflow.com/a/12017470/948268
Sasha Goldshtein
3-Jan-2016 at 11:51 amUnfortunately, this is incorrect:
> Memory – Commit Size – is the amount of virtual memory which is reserved, or committed, for the process.
Commit size does not reflect reserved memory. It wouldn’t make much sense if it did.
Also, Working Set counts only memory that is resident in RAM.