Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ih8reno

macrumors 65816
Original poster
Aug 10, 2012
1,383
206
I was curious about this and thought maybe one o you can help me. On my quad with 10gb of ram my vm size is about 40gb. Is this normal or something I should be worried about.
 

Attachments

  • Picture 2.png
    Picture 2.png
    24.3 KB · Views: 106

1042686

Cancelled
Sep 3, 2016
1,575
2,323
I was told years ago that VM shouldn't really be more than 2.5x your actual installed memory & ideally 1.5x. If it is more, the OS attempts to use it instead of your installed memory which slows down performance etc (swapping to disc is much slower vs. RAM). This was specifically a discussion in regards to windows gaming boxes but I don't think the os matters much.

Good luck.
 
Last edited:

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
VM memory size doesn't matter. It isn't written to disk. In simple terms, its fake or ghost memory that doesn't matter to the end user. The number that does matter is the swap number. That is what gets written to disk when ram space gets low.
 

Ih8reno

macrumors 65816
Original poster
Aug 10, 2012
1,383
206
VM memory size doesn't matter. It isn't written to disk. In simple terms, its fake or ghost memory that doesn't matter to the end user. The number that does matter is the swap number. That is what gets written to disk when ram space gets low.


Thank you both! guess I worried for nothing
 

1042686

Cancelled
Sep 3, 2016
1,575
2,323
Thank you both! guess I worried for nothing

Your welcome :)

I have a question for Intell - Is there a way to limit swaps? Do you limit swapping by reducing VM size ie: amount of swappable space? How does one manually adjust this in OSX or is it purely an automated function? Thanks!
 

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
In older versions of OS X you could have some control over the swap size by editing the launch daemon that spawns it. It is strongly recommended to not alter the swap parameters. The best way to limit the amount of swapping done, is to have enough memory and not overload your machine with open processes.
 
  • Like
Reactions: 1042686

1042686

Cancelled
Sep 3, 2016
1,575
2,323
Yeah, I was thinking about some of those older computers like clamshells for example that have less that 1gb of RAM. Then again, with one of those, having a good amount of swappable VM albeit slower is better than having none at all ... and well, doing nothing because you ran out of RAM.

Thanks! Sorry for hijacking your thread Ih8Reno :D
 

Ih8reno

macrumors 65816
Original poster
Aug 10, 2012
1,383
206
Yeah, I was thinking about some of those older computers like clamshells for example that have less that 1gb of RAM. Then again, with one of those, having a good amount of swappable VM albeit slower is better than having none at all ... and well, doing nothing because you ran out of RAM.

Thanks! Sorry for hijacking your thread Ih8Reno :D

All good, posts like this are great for everyone to learn more about their machines
 

jbarley

macrumors 601
Jul 1, 2006
4,023
1,893
Vancouver Island
I was curious about this and thought maybe one o you can help me. On my quad with 10gb of ram my vm size is about 40gb. Is this normal or something I should be worried about.
As a point of interest, my G5 quad has just 4GB ram and the vm runs about 40GB...
 

MagicBoy

macrumors 68040
May 28, 2006
3,947
1,025
Manchester, UK
I was told years ago that VM shouldn't really be more than 2.5x your actual installed memory & ideally 1.5x. If it is more, the OS attempts to use it instead of your installed memory which slows down performance etc (swapping to disc is much slower vs. RAM). This was specifically a discussion in regards to windows gaming boxes but I don't think the os matters much.

Good luck.

Those are windows specific numbers for the page file. They don't have any relevance to OS X.
 
  • Like
Reactions: 1042686

1042686

Cancelled
Sep 3, 2016
1,575
2,323
Those are windows specific numbers for the page file. They don't have any relevance to OS X.


Thanks for clarifying that. So what would be relevant to OSX? Is the correct number 10x the installed RAM? I just checked my 2Gh DP PMG5 with 4GB RAM and it too had a VM of approx 40GB so it seems like OSX likes the VM there. Why such a difference between Windows and OSX?

I was obviously oblivious to the oblund and obtuse opposition between OSX and the other operating system. Do you care to opine? :D
 
Last edited:

MagicBoy

macrumors 68040
May 28, 2006
3,947
1,025
Manchester, UK
Intell covered it in post 3.

Each process can have 4GB (32-bit) or 16EB (64-bit) of logical (virtual) memory space, so there is no correct number. The logical memory is divided into uniformly sized chunk called pages. The memory manager in OS X then maps logical memory pages to physical RAM or backing store as appropriate. Once the physical RAM runs low then OS X starts utilising the backing store (swap file) and performance will start to suffer.

There's a few rules for "the other operating system", where the page file defaults to 1.5x system RAM when created. Mainly so it can copy the contents of system RAM to the page file in the event of a blue screen for debugging purposes.
 

1042686

Cancelled
Sep 3, 2016
1,575
2,323
Intell covered it in post 3.

Each process can have 4GB (32-bit) or 16EB (64-bit) of logical (virtual) memory space, so there is no correct number. The logical memory is divided into uniformly sized chunk called pages. The memory manager in OS X then maps logical memory pages to physical RAM or backing store as appropriate. Once the physical RAM runs low then OS X starts utilising the backing store (swap file) and performance will start to suffer.

There's a few rules for "the other operating system", where the page file defaults to 1.5x system RAM when created. Mainly so it can copy the contents of system RAM to the page file in the event of a blue screen for debugging purposes.

I guess where I am confused is if the VM is irrelevant, then why have it at all and instead just let the OS manage swaps as it typically does? I mean its not like HDDs are tiny anymore. What circumstance would necessitate a user messing with it other than BSOD?
 

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
Don't confuse virtual memory with swap. They are very different things on OS X and other UNIX based machines.
 

1042686

Cancelled
Sep 3, 2016
1,575
2,323
So virtual memory is the drive space OSX allocates for files to be swapped? What I envisioned from the above replies is that VM is not real physical memory rather simply the total amount of drive space that OSX says it will use for swapping if RAM runs short.
 
Last edited:

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
No, virtual memory doesn't go anywhere. It doesn't exist anywhere. Don't look or even think of that number on OS X systems. Swap is not virtual memory. It is created as needed when real memory in the ram gets low automatically by the system. There is no need to for the system to make swap files on the hard drive, as it just takes up hard drive space.
 
  • Like
Reactions: MagicBoy

1042686

Cancelled
Sep 3, 2016
1,575
2,323
Ok. So in regards to OSX, when we talk about swapping, it is the computer swapping files (I assume to the hdd) in the event ram is used up. And I get that Swapping is completely separate from VM, So if VM is literally nothing, existing nowhere then why is it there? What is VM's function? Because what I thought VM was (space OS allocates for swapping) in OSX is actually not that. Sorry for the dingaling questions, I'm just royally confused I guess.
 
Last edited:

MagicBoy

macrumors 68040
May 28, 2006
3,947
1,025
Manchester, UK
When free physical RAM is low the OS memory manager relocates (pages out) inactive pages held in physical memory to swap. This frees up physical memory for another process to use. You'll tend to notice paging in from swap when you start using an application that has been running in the background and it stutters back into life.

The TL;DR of virtual memory benefits are :
1) Being able to utilise more memory than is physically installed
2) Stability - applications do not have to manage their own memory
3) Security - isolates applications from one another
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.