The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    OS X Virtual Memory

    Discussion in 'Apple and Mac OS X' started by Wooky, Aug 9, 2006.

  1. Wooky

    Wooky Notebook Evangelist

    Reputations:
    60
    Messages:
    692
    Likes Received:
    0
    Trophy Points:
    30
    Well, I thought I might post this in a thread of its own. I am still discovering OS X as you guys may know by now. After being puzzled like some other people by the space used by the OS, I found out that OS X's VM has a very enthusiastic approach, to say the least.
    [​IMG]
    here is a shot of the size used by the VM after a while. I was running Safari, Preview, and a few other tasks, like Virtue Desktops,Menu Meters and QuickSilver - nothing too fancy. Well, OS X decided to allocate almost 12GB of virtual memory!
    Upon closer inspection, I see that most threads would get about 100x its size in RAM of virtual memory allocated.
    Question is, is that normal? I know OS X has a somewhat different strategy for swapfiles, but this seems too much for me. Curiously, looking in the Terminal at /private/var/vm, where the swapfiles resides, gave a much lower number:

    Code:
    ls -lh /private/var/vm/
    total 2097152
    drwx--x--x   14 root  wheel       476B Jul 30 03:15 app_profile
    -rw------T    1 root  wheel       512M Jul 23 01:47 sleepimage
    -rw------T    1 root  wheel        64M Aug  9 23:15 swapfile0
    -rw------T    1 root  wheel        64M Aug  9 23:27 swapfile1
    -rw------T    1 root  wheel       128M Aug  9 23:28 swapfile2
    -rw------T    1 root  wheel       256M Aug  9 23:31 swapfile3
    
    Can someone explai what's going on? Also, do your Macbooks/MBPs also allocate this much swap?
     
  2. xbandaidx

    xbandaidx Notebook Deity

    Reputations:
    174
    Messages:
    1,402
    Likes Received:
    0
    Trophy Points:
    55
    Well first question is, are you noticing a slowdown or something?

    If not don't complain and follow the saying "If it isn't broken, don't fix it!"
     
  3. Wooky

    Wooky Notebook Evangelist

    Reputations:
    60
    Messages:
    692
    Likes Received:
    0
    Trophy Points:
    30
    No, no slowdown so far, but I like to understand how things work. And I'd like to know how much can I fill my HD - must I always spare 12GB for swap? It doesn't seem reasonable.
     
  4. xbandaidx

    xbandaidx Notebook Deity

    Reputations:
    174
    Messages:
    1,402
    Likes Received:
    0
    Trophy Points:
    55
    I just went in and chcked mine and my swapfile is 13GB.

    I think it's just setup that way, so if you fill up your ram it starts using that.

    I have 2GB of ram and have 1.23GB of memory free right now, now if I fill that up, it would start using the VM. I think its on-the-fly VM as well, meaning that is continually adjusts.

    According to my terminal, I'm only using 64M swap file right now, but I doubt it's being used.
     
  5. Wooky

    Wooky Notebook Evangelist

    Reputations:
    60
    Messages:
    692
    Likes Received:
    0
    Trophy Points:
    30
    Thanks, at least this means my Macbook is not going nuts.

    We can draw three conclusions:

    1- A large part of the "missing HD space" is going into swapfiles (assuming Activity Monitor is reporting the real thing). That means OS X itself doesn't take that much space, and *if* there are no problems once there is less than 10-12GB left on disk, everything is fine.
    2- The amount of swap (pre)allocated seems quite independent from the physical amount of RAM available, since I have 512MB and you have even more swap than I do, albeit with 2GB (which is the maximum amount of RAM the Macbook supports incidentally).
    3- Either Activity Monitor isn't reporting the real space used (in case my conclusions one and two above are moot) or not all swapfiles are located in /private/var/vm.

    Googling didn't show anything conclusive - other than a statement that the VM can indeed grow so big. I'll look at Apple forums and maybe post there.
     
  6. RadcomTxx

    RadcomTxx Notebook Deity

    Reputations:
    101
    Messages:
    873
    Likes Received:
    0
    Trophy Points:
    30
    wow, my ibooks VM is only about 4 gigs.

    i believe that the activity monitor reports how much is reserved, not necessarily how much is being used at that moment.