Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > virtual memory - too much on startup?

virtual memory - too much on startup?
Thread Tools
topcat
Junior Member
Join Date: Feb 2003
Location: Ann Arbor, Michigan
Status: Offline
Reply With Quote
May 1, 2007, 04:45 PM
 
Noticed I had less free disk space than I thought I should and on checking with Activity Monitor, saw that virual memory was taking up quite hunk, about 10 GB. Was not too suprised since it had been over a week since I rebooted. But after I rebooted, VM was still taking up 4.65 GB, which seems like a lot. Biggest piece seems to be kernel_task with 1.18 GB. Quite a few other processes have 100-200 MB VM each, e.g., WindowServer (~210 GB), Safari (~197 GB), Finder (~174 GB), System Preferences (~172 GB), etc. I am running 10.4.9 on a 1.67 GHz Powerbook with 2 GB RAM. Very little actual RAM is being used after the reboot. 1.67 GB is free. System speed seems pretty good.

Is it normal for a freshly booted system to use so much VM?
     
wingdo
Senior User
Join Date: Apr 2001
Location: Chicago, Earth
Status: Offline
Reply With Quote
May 1, 2007, 04:53 PM
 
The virtual memory reported by activity monitor seems to have nothing to do what so ever with your actual VM swapfile size. The system swapfile is in /private/var/vm At this moment, I show a VM size of 9.29GB in Activity Monitor, but I only have the single 64MB swapfile in use.

I really wish Apple would just make that number disappear as it confuses everyone it seems. Or they could at least actually tell you what the number represents.
MBP - 2.33GHz C2D, 3GB RAM, 256MB VRAM, 160GB HD
PB - 1.5GHz G4, 2GB RAM, 128MB VRAM, 80GB HD
PM - Dual 1GHzG4, 1.5GB RAM, NVidia GForce 3, 2x 80 GB HD
     
kick52
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
May 1, 2007, 05:22 PM
 
Originally Posted by topcat View Post
Noticed I had less free disk space than I thought I should and on checking with Activity Monitor, saw that virual memory was taking up quite hunk, about 10 GB. Was not too suprised since it had been over a week since I rebooted. But after I rebooted, VM was still taking up 4.65 GB, which seems like a lot. Biggest piece seems to be kernel_task with 1.18 GB. Quite a few other processes have 100-200 MB VM each, e.g., WindowServer (~210 GB), Safari (~197 GB), Finder (~174 GB), System Preferences (~172 GB), etc. I am running 10.4.9 on a 1.67 GHz Powerbook with 2 GB RAM. Very little actual RAM is being used after the reboot. 1.67 GB is free. System speed seems pretty good.

Is it normal for a freshly booted system to use so much VM?
Most applications are using OVER 100 GB? There is definately something wrong there.

You will find that all machines with enough memory use a lot of VM. Don't worry about it.
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
May 1, 2007, 05:34 PM
 
The confusion stems primarily from people thinking swap == virtual memory. Virtual memory is simply a technique for allowing each application to address a huge amount of memory without having to worry about working around other applications (it pretends it's alone in memory, basically). Swap then allows the virtual memory system to make good on its promises, rather than just crashing when an application uses more than is actually available.

One of the results of having a system that abstracts memory like this is that you can do all sorts of fun tricks to speed things up and conserve memory while appearing to consume huge amounts of virtual memory, such as:

Mapping shared libraries into multiple address spaces. This lets each app pretend it has its own copy of the library, when really they're all just one. They still show up in the VSIZE for each process though, since "virtually" there are N copies of the library. So all Cocoa apps, for example, start out with ALL of Cocoa, Carbon, etc... mapped into their address space.

Memory-mapped files. A developer can tell the OS to treat a file as paged out memory, essentially, so the application can just use it as though it was in ram and it will be paged in as needed. This means that the full size of the mmap'd file will show up in the VSIZE of the application.
     
topcat  (op)
Junior Member
Join Date: Feb 2003
Location: Ann Arbor, Michigan
Status: Offline
Reply With Quote
May 1, 2007, 10:24 PM
 
Oops! Kick52 caught my error. Only one process (kernel_task) has VM > 1 GB. Others are in the 100-200 MB range. Still big.

Checked the swap file size and it was not that big, only about 65 MB.

But still annoyed/concerned because it looks to me like the the VM usage is cutting into available file space. Still have about 5 GB free on the disk, but that is not a lot really.
     
Simon
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
May 2, 2007, 05:30 AM
 
Yeah, after a reboot you should only have one swap file which is 64 MB.

I wouldn't worry too much about the virtual memory size shown for each app. As Catfish_Man pointed out your swap space is not equal to the sum of al those entries (if it were I'd have about 10 GB of swap files right now ). Instead I'd keep my eye on the page out number. It tells you when the OS had to actually move stuff from RAM to disk. If you see a lot of page outs you'll get more (and larger) swap files.

That said, 5 GB isn't really a whole lot of free disk space. Maybe you should try finding wasted disk space or think about getting a new HDD.
( Last edited by Simon; May 2, 2007 at 05:37 AM. )
     
jtrwallace
Junior Member
Join Date: Dec 2006
Status: Offline
Reply With Quote
May 2, 2007, 05:36 AM
 
5 GB isn't enough. That's cutting it way too close in my experience. You definitely should consider getting an external HDD. I have 80 GB internal and I leave 20 GB unused. I have 500 GB external and use about 300 GB of it. Very useful with large iTunes libraries.
     
Don Pickett
Professional Poster
Join Date: Mar 2000
Location: New York, NY, USA
Status: Offline
Reply With Quote
May 3, 2007, 01:54 PM
 
Originally Posted by Catfish_Man View Post
Mapping shared libraries into multiple address spaces. This lets each app pretend it has its own copy of the library, when really they're all just one. They still show up in the VSIZE for each process though, since "virtually" there are N copies of the library. So all Cocoa apps, for example, start out with ALL of Cocoa, Carbon, etc... mapped into their address space.
I was about to point out this quirk of looking at OS X's memory stats: every virtual instance of a shared library is reported as memory used for a specific application. So, fr'instance, if three different apps are using the same library, each application's memory usage will reflect the size of that library, even though the library is only extant in memory one time. It's one of the reasons for those huge virtual memory figures.
The era of anthropomorphizing hardware is over.
     
kick52
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
May 3, 2007, 02:34 PM
 
if i have about 7-9gb left, my ibook becomes unusable when safari is running, which sucks ass.
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 08:35 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,