Pushing the Limits: Virtual Memory

Page 1 of 3 123 LastLast

    Pushing the Limits: Virtual Memory


    Posted: 20 Nov 2008
    Pushing the Limits of Windows: Virtual Memory.

    In my first post; I discussed physical memory limits, including the limits imposed by licensing, implementation, and driver compatibility. This time I’m turning my attention to another fundamental resource, virtual memory. Virtual memory separates a program’s view of memory from the system’s physical memory, so an operating system decides when and if to store the program’s code and data in physical memory and when to store it in a file. The major advantage of virtual memory is that it allows more processes to execute concurrently than might otherwise fit in physical memory.

    While virtual memory has limits that are related to physical memory limits, virtual memory has limits that derive from different sources and that are different depending on the consumer. For example, there are virtual memory limits that apply to individual processes that run applications, the operating system, and for the system as a whole. It's important to remember as you read this that virtual memory, as the name implies, has no direct connection with physical memory. Windows assigning the file cache a certain amount of virtual memory does not dictate how much file data it actually caches in physical memory; it can be any amount from none to more than the amount that's addressable via virtual memory.

    Process Address Spaces

    Each process has its own virtual memory, called an address space, into which it maps the code that it executes and the data that the code references and manipulates. A 32-bit process uses 32-bit virtual memory address pointers, which creates an absolute upper limit of 4GB (2^32) for the amount of virtual memory that a 32-bit process can address. However, so that the operating system can reference its own code and data and the code and data of the currently-executing process without changing address spaces, the operating system makes its virtual memory visible in the address space of every process. By default, 32-bit versions of Windows split the process address space evenly between the system and the active process, creating a limit of 2GB for each.

    Applications might use Heap APIs, the .NET garbage collector, or the C runtime malloc library to allocate virtual memory, but under the hood all of these rely on the VirtualAlloc API. When an application runs out of address space then VirtualAlloc, and therefore the memory managers layered on top of it, return errors (represented by a NULL address). The Testlimit utility, which I wrote for the the fourth edition of Windows Internals to demonstrate various Windows limits, calls VirtualAlloc repeatedly until it gets an error when you specify the –r switch. Thus, when you run the 32-bit version of Testlimit on 32-bit Windows, it will consume the entire 2GB of its address space.

    Read more at the source.


    Later Ted
    Bare Foot Kid's Avatar Posted By: Bare Foot Kid
    20 Nov 2008



  1. Posts : 80
    Windows 7 build 6956
       #1

    I have 2GB RAM and have never used it up before. Even when running Windows 7 with as much programs as I can use, it's only take about 1GB.
    So my question is should I disable the Virtual Memory Function to improve performance?
      My Computer


  2. Posts : 22,814
    W 7 64-bit Ultimate
    Thread Starter
       #2

    Hello natri23.

    If it ain't broke don't fix it!...

    Seriously though think about this: If it didn't get used and is necessary why would they go to so much trouble to develop it and add it to the OS at all?

    You disabling it would hinder performance.










    Later Ted
      My Computer


  3. Posts : 31,249
    Windows 11 Pro x64 [Latest Release and Release Preview]
       #3

    Hi Natri23

    I would advise that you follow Ted's good advice, as both the OS and applications written for it, expect the virtual memory to be present.

    I know users on vista have had problems after disabling it. Obviously Seven may be different but unless you are seriously short of disk space - I'd leave it as it is
      My Computers


  4. Posts : 80
    Windows 7 build 6956
       #4

    Thank you guys, I just think simply that RAM has a better speed than my hard disk's one
    And one more question. I know that it's better to leave the pagefile at the first partition of the hard disk but my Windows 7 is on the third partition. So should I still leave the pagefile at the first partition or better the same one with my system
      My Computer


  5. Posts : 22,814
    W 7 64-bit Ultimate
    Thread Starter
       #5

    Bare Foot Kid said:
    Hello natri23.

    If it ain't broke don't fix it!...














    Later Ted
    ...
      My Computer


  6. Posts : 26
    Windows 7 Build 7000
       #6

    I am using the CPU Meter Gadget and my Memory Button is Constantly around 50-70% I have my Virtual Memory Set on all drives I have to use whatever. My Question is... is my computer using any of the virtual memory? Why is my gadget always showing high memory usage. Don't get me wrong the computer Runs very smoothly. just curious why. and Not sure I understand when Virtual memory kicks in or not. any info?
      My Computer


  7. Posts : 22,814
    W 7 64-bit Ultimate
    Thread Starter
       #7

    Hello shadowminx69, welcome to Se7en Forums!


    How much actual RAM do you have onboard; are you using a 32-bit or 64-bit Windows 7?















    Later Ted
      My Computer


  8. Posts : 26
    Windows 7 Build 7000
       #8

    I have 1gb ram and I am running 32-bit.
      My Computer


  9. Posts : 22,814
    W 7 64-bit Ultimate
    Thread Starter
       #9

    shadowminx69 said:
    I have 1gb ram and I am running 32-bit.

    Hello again.


    If your motherboard will support it, I would add at least 1GB more of RAM; 32-bit really does way better with 2GB; 4GB would be way better. When I had 4GB with 32-bit Vista, the system idled at 25 to 30% RAM usage.

    Yes, your system is using the swap file; leave it at "System Managed".




    Later Ted
      My Computer


 
Page 1 of 3 123 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:29.
Find Us