Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Virtual Memory / Virtual Memory Manager...

Virtual Memory / Virtual Memory Manager...

Scheduled Pinned Locked Moved System Admin
algorithmsjsonperformancetutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kinar
    wrote on last edited by
    #1

    Ok, it seems that the standard windows belief is that Virtual Memory = Pagefile/Swapfile. However, this isn't the case (searching bing/google will result in a ton of posts by microsoft MVPs indicating this but none of them bother to actually explain anything other than "don't mess with it if you don't know what you are doing"). Well, I'm trying to learn what I'm doing here and what I've found certainly agrees with what they are saying. For example, if you completely disable the pagefile on a machine, taskmanager still reports programs using virtual memory. So other than the pagefile, where does windows store virtual memory? Is it still on the hard drive in some unmanagable location? Or is it in RAM that is reserved for the OS? Or is it in RAM but simply non-contiguous from the rest of the memory allocated for an application and the number displayed in task manager is simply displaying total memory used by the application minus the initial allocation? Anyone have any good sites that actually explain what the virtual memory manager in windows is doing? apparently it is one of the oldest concepts in computing yet noone seems to know anything about it.

    L M 2 Replies Last reply
    0
    • K kinar

      Ok, it seems that the standard windows belief is that Virtual Memory = Pagefile/Swapfile. However, this isn't the case (searching bing/google will result in a ton of posts by microsoft MVPs indicating this but none of them bother to actually explain anything other than "don't mess with it if you don't know what you are doing"). Well, I'm trying to learn what I'm doing here and what I've found certainly agrees with what they are saying. For example, if you completely disable the pagefile on a machine, taskmanager still reports programs using virtual memory. So other than the pagefile, where does windows store virtual memory? Is it still on the hard drive in some unmanagable location? Or is it in RAM that is reserved for the OS? Or is it in RAM but simply non-contiguous from the rest of the memory allocated for an application and the number displayed in task manager is simply displaying total memory used by the application minus the initial allocation? Anyone have any good sites that actually explain what the virtual memory manager in windows is doing? apparently it is one of the oldest concepts in computing yet noone seems to know anything about it.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, there are two parts to virtual memory: 1. your app uses "logical addresses", your machine's hardware provides memory located at some "physical addresses". These don't have to correspond in a one-to-one relation because the MMU (Memory Management Unit, part of the CPU) translates logical-to-physical. Without a memory extension (as in pagefile/swapfile) your app can have as much logical memory as it is allotted physical memory (the "working set"), while the logical addresses don't need to be consecutive. The advantage is your app can set up different data structures (e.g. stacks) with some initial size, and grow them as needed (until the working set is exhausted). 2. when you add a swap file/page file to the system, your app now can have more logical address space than it is allotted physical address space; the extra space is allocated in the file on disk. Furthermore the app's working set can be adjusted dynamically, e.g. a Windows app that loses focus (e.g. main form gets minimized) will have its working set reduced, hence the excess physical memory is copied to the page file and becomes available to some other process. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


      1 Reply Last reply
      0
      • K kinar

        Ok, it seems that the standard windows belief is that Virtual Memory = Pagefile/Swapfile. However, this isn't the case (searching bing/google will result in a ton of posts by microsoft MVPs indicating this but none of them bother to actually explain anything other than "don't mess with it if you don't know what you are doing"). Well, I'm trying to learn what I'm doing here and what I've found certainly agrees with what they are saying. For example, if you completely disable the pagefile on a machine, taskmanager still reports programs using virtual memory. So other than the pagefile, where does windows store virtual memory? Is it still on the hard drive in some unmanagable location? Or is it in RAM that is reserved for the OS? Or is it in RAM but simply non-contiguous from the rest of the memory allocated for an application and the number displayed in task manager is simply displaying total memory used by the application minus the initial allocation? Anyone have any good sites that actually explain what the virtual memory manager in windows is doing? apparently it is one of the oldest concepts in computing yet noone seems to know anything about it.

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Available virtual memory = physical RAM + swap file size. Disabling the swap file just reduces the total amount of virtual memory that can be in use at once. Also, disabling swap doesn't prevent programs from opening a file and mapping it into memory with MapViewOfFile(). You'll always see virtual memory in use because all addresses in user space are virtual addresses. That's one of the parts of the mechanism that gives each process its own address space.

        --Mike--

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups