Sysinternals Homepage
Forum Home Forum Home > Windows Discussions > Internals
  New Posts New Posts RSS Feed - What is "Working set" vs. "Virtual size"?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

What is "Working set" vs. "Virtual size"?

 Post Reply Post Reply
Author
Message
thoste View Drop Down
Groupie
Groupie


Joined: 21 July 2005
Location: Germany
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote thoste Quote  Post ReplyReply Direct Link To This Post Topic: What is "Working set" vs. "Virtual size"?
    Posted: 04 March 2009 at 2:37pm
What is the difference between "Working Set" and the "virtual size" of a process?
 
Which value reflects the real usage of physical and virtual memory?
 
What is furthermore the diff between "Maximum working set" and "Peak working set size"?
Isn't it the same?
 
Thomas
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 2:47am
Hi Thomas,

From explanation of performance counters in Perfmon:
Virtual Size (Virtual Bytes):
Quote Virtual Bytes is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.


From Windows Internals:
Quote The subset of a process's virtual address space that is physically resident is called the working set.


Private bytes is the amount of (virtual) memory committed by a process.

The peak working set size is the largest working set that has been observed for the process.

From "Process Working Set":
Quote A process has an associated minimum working set size and maximum working set size. Each time you call CreateProcess, it reserves the minimum working set size for the process. The virtual memory manager attempts to keep enough memory for the minimum working set resident when the process is active, but keeps no more than the maximum size.

Daily affirmation:
net helpmsg 4006
Back to Top
zakk View Drop Down
Groupie
Groupie


Joined: 13 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote zakk Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2011 at 10:17am
@molotov
How is the Available Memory calculated in System Information > Memory tab > Physical Memory ?
Is it the size of RAM minus: a) the sum of all processes'Private Bytes OR b) the sum of all the processes'Working Sets?

And, in general, which of the 3 columns (Virtual size, Working set and Private bytes)
should you suggest to check for process memory usage?


I'm confused Confused


Edited by zakk - 08 November 2011 at 10:22am
Back to Top
Dax1792 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 15 March 2011
Status: Offline
Points: 587
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dax1792 Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2011 at 12:24pm
Back to Top
LMiller7 View Drop Down
Moderator Group
Moderator Group


Joined: 27 May 2011
Status: Offline
Points: 189
Post Options Post Options   Thanks (0) Thanks(0)   Quote LMiller7 Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2011 at 2:17pm

Available memory is defined as the sum of the standby list plus free memory. There is far more to total memory usage than the sum all process working sets. Because of this and due to memory sharing this value is not generally very useful.

The virtual size of a process is the portion of a process virtual address space that has been allocated for use. There is no relationship between this and physical memory usage.

Private bytes is the portion of a processes virtual address space that has been allocated for private use. It does not include shared memory or that used for code. There is no relationship between this value and physical memory usage either.

Working set is the amount of physical memory in use by a process. Due to memory sharing there will be some double counting in this value.

The terms mentioned above aren't really going to mean very much until you understand the basic concepts in Windows memory management. This is not simple. A good start in understanding this would be the resources mentioned by Dax1782.

Back to Top
zakk View Drop Down
Groupie
Groupie


Joined: 13 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote zakk Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2011 at 10:15pm
Thanks for the useful posts.

When you run windows Task Manager, it shows the "Private Working Set" column.
Originally posted by LMiller7 LMiller7 wrote:

Working set is the amount of physical memory in use by a process. Due to memory sharing there will be some double counting in this value.

Does "Private Working Set" avoid duplicate counting ?

On the other hand, when you first run Process Explorer,
it doesn't display the "Private WS" column by default - it displays the "Private Bytes" and "Working Set" columns instead.




I'll read the posts that Dax1782 gave as soon as I have some free time.



Edited by zakk - 15 November 2011 at 10:29pm
Back to Top
LMiller7 View Drop Down
Moderator Group
Moderator Group


Joined: 27 May 2011
Status: Offline
Points: 189
Post Options Post Options   Thanks (0) Thanks(0)   Quote LMiller7 Quote  Post ReplyReply Direct Link To This Post Posted: 16 November 2011 at 4:51am

A portion of the working set will be shared with other processes. DLL's are shared among multiple processes but there is only one copy in physical memory. The memory thus used is shown in the Working Set of each process that uses them. This double counting. But as the name implies, Private Working Set is not shared. Without sharing there can be no double counting. But of course Private Working Set does not account for full memory usage.

This is a complex subject and cannot be fully dealt with in a forum. You really need to do some study, such as from the resources mentioned.



Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down