Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 03-28-2012, 08:39 AM   #1
KieferThomas
Prospect
 
Join Date: Mar 2012
Posts: 9
Question How can there be Virtual Memory when Paging is disabled

Hello All,

I am new to the Mac world and recently bought a late 2011 MBP 2011 13" with the i5 processor.

What I have been trying to figure out is how can there be a VM size of: 193G when I have Dynamic paging disabled?

Could someone please shed some light on this for me?

Thanks in advance,
KieferThomas
KieferThomas is offline   Reply With Quote
Old 03-28-2012, 10:16 AM   #2
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,847
Please let us know your version of OS X, how much memory (not hard drive) you have installed, and exactly, precisely, and in great detail what method you used to disable dynamic paging. Then let us know where you are getting your VM size statistic from.

Trevor
trevor is offline   Reply With Quote
Old 03-28-2012, 10:35 AM   #3
benwiggy
League Commissioner
 
Join Date: Aug 2006
Location: London
Posts: 5,829
Given this and your other thread about trying to remove "unnecessary" kexts, and that you claim to be new to the Mac world, can I ask why you are trying to modify your Mac in these radical ways?
http://hintsforums.macworld.com/showthread.php?t=146340

What are you trying to achieve? Your Mac should run optimally without you having to managing the memory and kernel extensions yourself.

I suspect that you will just spend a lot of time and effort and not see any benefit -- or actually make things worse.

Indeed, it seems that disabling paging may cause Wired memory to continue to grow without being released.

“Wired memory is not immediately released back to the free list when it becomes invalid. Instead it is “garbage collected” when the free-page count falls below the threshold that triggers page out events.”
http://developer.apple.com/library/m...9714-TPXREF106

Last edited by benwiggy; 03-28-2012 at 10:56 AM.
benwiggy is offline   Reply With Quote
Old 03-28-2012, 11:46 AM   #4
KieferThomas
Prospect
 
Join Date: Mar 2012
Posts: 9
Quote:
Originally Posted by trevor
Please let us know your version of OS X, how much memory (not hard drive) you have installed, and exactly, precisely, and in great detail what method you used to disable dynamic paging. Then let us know where you are getting your VM size statistic from.

Trevor

Trevor,

I am using Mac OS X Lion 10.7.3 (11D50), 8G of ram.

I disabled Dynamic Paging using:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

I am getting the VM from Activity Montor : System Memory : VM size.

Thanks Trevor.

Side Note:
For the record I am a REAL Mac transplant for using either virtualization or a Hackintosh. The two worlds of REAL Mac and the others are totally different and I am finding out what holds true in the others does not hold true in the Real Mac world. So I am a Newbie to the Mac World.

Last edited by KieferThomas; 03-28-2012 at 11:58 AM.
KieferThomas is offline   Reply With Quote
Old 03-28-2012, 02:14 PM   #5
agentx
Hall of Famer
 
Join Date: Feb 2003
Location: Brighton, UK
Posts: 4,122
@KieferThomas

Please stop as you are getting to point that will more than likely start messing up your system and stability. Let Mac OS do its Unix magic under the hood and get on and and enjoy your new Mac. You are trying to "fix" things that are not broken ;-)
agentx is offline   Reply With Quote
Old 03-28-2012, 03:56 PM   #6
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,847
Quote:
Originally Posted by KieferThomas
I am using Mac OS X Lion 10.7.3 (11D50), 8G of ram.

I disabled Dynamic Paging using:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

I've seen that command used in Snow Leopard, but I'm not sure if it works the same in Lion or not. Do you have any documentation other than your own experience about it working with Lion?

Quote:
Originally Posted by KieferThomas
I am getting the VM from Activity Montor : System Memory : VM size.

What do you get from the following commands, copy/pasted into your Terminal?

du -sh /var/vm
ls -lh /var/vm
vm_stat
echo "done"


Trevor
trevor is offline   Reply With Quote
Old 03-28-2012, 04:03 PM   #7
benwiggy
League Commissioner
 
Join Date: Aug 2006
Location: London
Posts: 5,829
Also note that in the MacOSXHint that trevor has linked to, the comments show mixed results. Some people report crashing, freezing and slowness; others report no difference; some report an improvement.

Others suggest that VM gets turned on again after running the command:

"I've noted that after about three hours of work on my 2006 MBP with only 2Gb of RAM, swap has been reactivated, so I gather the system kind of protects itself against a potential shortage of memory by reinstating virtual memory after a while. That, or putting your Mac to sleep reactivates VM somehow... I did that, but I don't know if VM came back after my MBP woke up, or if it was already back before it even went to sleep..."

"I ran the terminal commands>Restarted>Opened Activity Monitor>Chose the System Memory Tab>VM Size: around 190.55GB… Shouldn’t this be 0?"
benwiggy is offline   Reply With Quote
Old 03-28-2012, 05:37 PM   #8
KieferThomas
Prospect
 
Join Date: Mar 2012
Posts: 9
Trevor,

The documentation I have used is from the net and the:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist was listed on multiple pages for Lion 10.7.3 as well as for Snow Leo.

I have run the commands from the terminal with what I am believing is the Dynamic Paging disabled with the following results:

Keiths-MacBook-Pro:~ Kiefers$ du -sh /var/vm
8.0G /var/vm
Keiths-MacBook-Pro:~ Kiefers$ ls -lh /var/vm
total 16777216
-rw------T 1 root wheel 8.0G Mar 27 17:58 sleepimage
Keiths-MacBook-Pro:~ Kiefers$ vm_stat
Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free: 1379496.
Pages active: 53312.
Pages inactive: 54869.
Pages speculative: 211569.
Pages wired down: 397437.
"Translation faults": 2686483.
Pages copy-on-write: 430643.
Pages zero filled: 839090.
Pages reactivated: 1.
Pageins: 45018.
Pageouts: 0.
Object cache: 11 hits of 5221 lookups (0% hit rate)

Thanks,
KieferTomas
KieferThomas is offline   Reply With Quote
Old 03-28-2012, 06:12 PM   #9
acme.mail.order
League Commissioner
 
Join Date: Sep 2003
Location: Tokyo
Posts: 6,334
Quote:
Originally Posted by KieferThomas
Trevor,

I am using Mac OS X Lion 10.7.3 (11D50), 8G of ram.

Then you will probably rarely actually use paged memory. I have 6Gb, and /var/vm barely gets any use.

Virtual memory is built into unix systems at a very low level - some of the OS install CDs even set up a ramdisk for virtual memory (and if that isn't the definition of "pointless") probably because it was easier than disabling the whole thing.

As others have said, you are tinkering with some very low-level processes that take care of themselves just fine - the end result is more likely a broken system than a better system.

Last edited by acme.mail.order; 03-28-2012 at 06:43 PM.
acme.mail.order is offline   Reply With Quote
Old 03-29-2012, 01:25 AM   #10
SirDice
MVP
 
Join Date: Aug 2009
Posts: 1,119
Modern operating systems always use some virtual memory. If only for some basic housekeeping. Turning off virtual memory may even impact performance in a negative way. Regardless of how much physical memory the machine has.
SirDice is offline   Reply With Quote
Old 03-29-2012, 02:59 AM   #11
NaOH
Hall of Famer
 
Join Date: Dec 2007
Posts: 3,845
Quote:
Originally Posted by KieferThomas
The documentation I have used is from the net....

In case it's of use to those trying to help, these links may be of use (the comments at both are probably worth a look):

Article from the main Hints site

Article referenced in that hint from OS X Daily
NaOH is online now   Reply With Quote
Old 03-29-2012, 10:49 AM   #12
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,847
Code:
Keiths-MacBook-Pro:~ Kiefers$ ls -lh /var/vm
total 16777216
-rw------T 1 root wheel 8.0G Mar 27 17:58 sleepimage
The only thing you have in your /var/vm directory (which is where swapfiles are stored) is your sleep image. The sleep image is not related to dynamic paging, it's what is used to store the contents of your memory when your computer goes into deep sleep. Although I am not an expert on this, and there may be some other component of which I'm not aware, based on the above I don't believe that you are using dynamic paging, despite what Activity Monitor is telling you about virtual memory.

Trevor

Last edited by trevor; 03-29-2012 at 11:11 AM.
trevor is offline   Reply With Quote
Old 03-29-2012, 11:09 AM   #13
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,847
I've been reading about virtual memory, and I believe that the disconnect is in interpretation.

Activity Monitor is correctly telling you that your computer is using 193 GB of virtual memory, because (as acme.mail.order and SirDice both mention above), you can't really turn off virtual memory, it's being used for memory management of your entire memory space. You didn't and probably cannot turn off virtual memory.

What you turned off is dynamic paging, and dynamic paging is one tool in the toolchest of virtual memory, but it is not the same thing. Dynamic paging is when pages of memory are swapped out to your hard drive. And from the fact that you aren't using any swapfiles, I believe that you have successfully turned off dynamic paging, at least at the point in time when you checked the /var/vm directory.

As mentioned above, I'm not an expert in this subject, and I welcome feedback from people who know more about it than I do.

Trevor
trevor is offline   Reply With Quote
Old 03-29-2012, 12:38 PM   #14
KieferThomas
Prospect
 
Join Date: Mar 2012
Posts: 9
Trevor,

Thank you for the link and the reply and a direct answer to my question. From the way I was interpreting it the dynamic paging was being used like Windoz uses the swapfile and now from your response and the link I see this is not the case.

Thanks again,
Kiefer
KieferThomas is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 06:37 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.