Thread: Still confused why working set larger than virtual memory

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    Still confused why working set larger than virtual memory

    Hello everyone,


    Sorry that this question is related to another question I posted some time before because I have some new findings and self-analysis.

    My question is why sometimes from perfmon on Windows, working set larger than virtual memory? I think virtual memory is the total size of memory (committed, reserved, shared, private) and working set is just the RAM touched by current process currently. Virtual memory should always larger than working set...

    But, I write a simple program to show working set is larger than virtual memory from perfmon. The program is simple, just open a couple of memory map files and read from beginning to the end.

    The only reason I could think of why working set sometimes is larger than virtual memory is, the OS memory management component may not reclaim some RAM consumed by current process even if the current process does not use the RAM. And keeping such RAM could improve performance if the process will use it in the future. But this point makes me confused because I think if it is true, such RAM does not have related virtual memory address, how could the current process utilize or even address (re-use to avoid hard page fault) it in the future?


    thanks in advance,
    George

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,412
    I have moved this thread to the Tech board as it does not seem to be specific to C++ programming.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    I've never seen the working set larger than the virtual size. At this stage I'm inclined to be struck with disbelief.
    Care to post some numbers?
    What operating system?
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Hi iMalc,


    I am using Windows Server 2003. I watch the working set and virtual bytes counter from perfmon of iexplorer process (IE7 browser).

    It is usually the size of working set of larger than that of virtual bytes. I have uploaded the screen snapshot for your reference. It is appreciated if you could share some perspective. :-)

    Quote Originally Posted by iMalc View Post
    I've never seen the working set larger than the virtual size. At this stage I'm inclined to be struck with disbelief.
    Care to post some numbers?
    What operating system?

    regards,
    George

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks laserlight,


    Quote Originally Posted by laserlight View Post
    I have moved this thread to the Tech board as it does not seem to be specific to C++ programming.

    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Virtual Memory utilization during run-time
    By wots_guge in forum C Programming
    Replies: 2
    Last Post: 04-13-2006, 08:17 PM
  2. virtual memory
    By sweets in forum C Programming
    Replies: 6
    Last Post: 11-06-2004, 06:55 AM
  3. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM
  4. C++ XML Class
    By edwardtisdale in forum C++ Programming
    Replies: 0
    Last Post: 12-10-2001, 11:14 PM