Excessive VM size in 10.4.2/10.4.3

Discussion in 'macOS' started by subzero, Nov 2, 2005.

  1. subzero macrumors newbie

    Nov 2, 2005
    Hello MacRumours

    This is my first thread here at this great forum (been browsing it for the past month, before buying my PB).

    Problem is however, that I think the VM size is excessive - right now, according to "top" and Activity Monitor, my system is using 7.07GB VM, even though my system has 833MB free memory (just installed another GB besides the standard 512MB).

    The problem did also exist before installing this memory upgrade and also back with 10.4.2.
  2. bousozoku Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    I think that they finally got this right and it should be that way. My performance has been consistent and VM seems to be working well for the first time since 10.3.6. With 10.4.2, it stuttered terribly as it would load a little and ran into a problem and pretty much stopped to load more. Now, it just goes.
  3. subzero thread starter macrumors newbie

    Nov 2, 2005
    Alright bousozoku - but doesn't it just use a lot of unneccesary hd-space?
  4. Makosuke macrumors 603

    Aug 15, 2001
    The Cool Part of CA, USA

    The "virtual memory" listed is exactly that--entirely virtual. It's basically space that *could* be used (you could think of it as sort of a theoretical maximum), but almost no apps actually make use of anywhere near what's reserved for them.

    This system is, I think, why you don't have to sepcifically identify how much memory is reserved for each app, and it's entirely different from the way that older VM systems worked. Essentially, the "Real Memory" value is all you're really intereted in.

    If you want to confirm that all that "virtual" memory isn't taking up hard disk space, you can look at two things--the number of pageouts (that will only go up when memory is being written to disk), and the fact that your available hard drive space doesn't decrease regardless of how much VM your system has reserved.

    For example, I currently have 9GB of VM reserved, and I don't even have that much free HD space, so obviously it's not using that much.
  5. bousozoku Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    Mine is only set to about 3 GB more than it the 4.xx GB that it was using. It's only unnecessary until the system can't function properly, right? Simply consider it system overhead and be done with it. It's one more thing that shouldn't really matter as long as your computer does everything you want it to do.
  6. ElectricSheep macrumors 6502


    Feb 18, 2004
    Wilmington, DE
    That number is really just a reflection of the total virtual address space that is being used. Just address space. I could write a program that allocated a two gig block of memory, but it won't actually consume any physical resources (either disk or RAM). It will just be a huge 2 gig virtual address space.

    If, on the other hand, my program began to read and write all kinds of values to this 2 gig address space, you will see a lot of physical resources being consumed. I've actually done this through a small programmer error--a rendering engine began to draw vectors across a 1.5 gig image space on a machine with only 512 megs of real memory. It took a while and with lots of disk thrashing, but it successfully rendered the image...


    If you have the developer tools installed, you can see this effect in action with this small program:

    #include <stdlib.h>
    #include <stdio.h>
    int main( int argc, char **argv )
            int *myHugeAddressSpace;
            myHugeAddressSpace = malloc( 2000000000 * sizeof( char ));
            return 0;
    All this program does is allocate a 2 gig address space, and then waits for a character input before exiting. This is so you can run and check your VM stats while the program is running. Sure enough, when you run it your 'VM Size' will jump by 2 gigs. You will not see any real change in the number of page ins/page outs.

    If you want to see how much disk space is being used by the virtual backing store (this is where pages get written out to disk), check the contents of /var/vm/ :

    ls -lh /var/vm

Share This Page