Previous 1 2 Next 26 Replies Latest reply: Mar 14, 2013 8:06 AM by hejish
Nightshade0six Level 1 Level 1 (0 points)

Okay - I cannot account for quite a few Gig's on my HD.  I ran WhatSize and came across 44.0 GB in Private/Var/VM.  4.29 GB was the sleepimage, but I have Swapfiles's 5 - 40 at 1.07 GB each (approx. 37 GB total). 

 

In terminal, I ran:

 

sudo du -h -d1 /var/vm

Password: *****

37G          /var/vm

 

My suspicion is that this is highly unusual, but I've been cautioned to avoid deleting or messing with them.

 

Is this indeed unusual?  Are there any suggested remedies?

 

 

Your help is very much appreciated.

 

 

Thanks!


MacBook Pro (13-inch Mid 2009), Mac OS X (10.6.8)
  • X423424X Level 6 Level 6 (14,205 points)

    When was the last time you rebooted?

     

    Out of curiousity do this:

     

    ls -la /var/vm

     

    Do not under any circumstances delete any files in /var/vm.  You cannot "manually" delete the swap space.  You do and you will be rebooting soon!

     

    The sleepimage is the file that is written when you deep sleep (hibernate) your machine.  It should be about the same size as the amount of ram you have.

  • Nightshade0six Level 1 Level 1 (0 points)

    Thank you -

     

    Using the command you mentioned:

     

    total 81788928

    drwxr-xr-x  44 root  wheel        1496 Feb 12 23:42 .

    drwxr-xr-x  26 root  wheel         884 Nov 14  2009 ..

    -rw------T   1 root  wheel  2147483648 Feb 12 23:42 sleepimage

    -rw-------   1 root  wheel    67108864 Feb 12 23:24 swapfile0

    -rw-------   1 root  wheel    67108864 Feb 12 23:46 swapfile1

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile10

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile11

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile12

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile13

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile14

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile15

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile16

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile17

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile18

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile19

    -rw-------   1 root  wheel   134217728 Feb 12 23:46 swapfile2

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile20

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile21

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile22

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile23

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile24

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile25

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile26

    -rw-------   1 root  wheel  1073741824 Feb 12 23:24 swapfile27

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile28

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile29

    -rw-------   1 root  wheel   268435456 Feb 12 23:24 swapfile3

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile30

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile31

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile32

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile33

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile34

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile35

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile36

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile37

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile38

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile39

    -rw-------   1 root  wheel   536870912 Feb 12 23:46 swapfile4

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile40

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile5

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile6

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile7

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile8

    -rw-------   1 root  wheel  1073741824 Feb 12 23:46 swapfile9

     

    I've shut down and restart a couple times over the past few (3-7) days although I should definitely do it more so than current.

     

    I also dumped the sleepimage earlier through terminal after reading several posts on the subject.  It was double the size of my RAM and from my understanding will reappear on next hibernation.

  • X423424X Level 6 Level 6 (14,205 points)

    I also dumped the sleepimage earlier through terminal after reading several posts on the subject.  It was double the size of my RAM and from my understanding will reappear on next hibernation.

    If you want to turn of hibernation you can with pmset for hibernatemode (man pmset).

     

    41 swap files and only running under 7 days.  Yup, that's a bit excessive!  Sounds like you are running some process that may have a memory leak.  Might want to monitor memory with top or Activity Monitor.

     

    I guess I have to ask, how much ram do you have and how many apps do you keep concurrently running?

  • Nightshade0six Level 1 Level 1 (0 points)

    Thanks again -

     

    Will a restart erase these Swapfile's?  Memory has been running very low lately as well with minimal applications opened (Chrome, Terminal, Finder).

  • Nightshade0six Level 1 Level 1 (0 points)

    Also, if I'm reading the output correctly, were all these Swapfiles created on Feb 12?

  • X423424X Level 6 Level 6 (14,205 points)

    Yes, reboot will remove the swapfiles which is why I originally asked when was the last time you rebooted.  I updated my previous post and I think we overlapped while you were creating your reply.  I added,

     

    I guess I have to ask, how much ram do you have and how many apps do you keep concurrently running?

  • X423424X Level 6 Level 6 (14,205 points)

    Also, if I'm reading the output correctly, were all these Swapfiles created on Feb 12?

     

    I am not totally clear on the mod dates on  swapfiles.  So I don't know for sure if they were all created then or it's just part of the swapping algorithm when it accesses the various portions of those files.

  • Nightshade0six Level 1 Level 1 (0 points)

    I have 2GB RAM and run minimal apps.  Right now I have 188.48 MB available and am running Chrome, Terminal and Whatsize.  Earlier it was between 8-12 MB running the same apps plus or minus one (such as activity monitor).

     

    I did however add a Virtual Box VM for Windows 7 a couple days ago - I don't see how, but could this be part of the issue?

  • X423424X Level 6 Level 6 (14,205 points)

    If you look at Activity Monitor or do a top I think virtual box has a bunch of launchagents or launchdaemons (don't recall at the moment) which may be running and maybe they could be sucking up resouces.  You only have 2GB which IMO is a pretty small amount which might explain the excessive paging.

     

    Check these dirctories,

     

    /Library/LaunchAgents

    /Library/LaunchDaemons

    /Library/StartupItems

     

    You might want to experiment and consider uninstalling Virtual Box.

  • Nightshade0six Level 1 Level 1 (0 points)

    Awesome - I'll check them out.  Thank you very much for your help! 

     

    I'm tempted by ditching Virtual Box (perhaps Fusion?) - I just need a linux or W7 VM to run my Cisco programs.

  • X423424X Level 6 Level 6 (14,205 points)

    I suggest you consider upgrading your memory to a minimum of 4GB.  The more the better.  I always recommend OWC for memory.

  • Nightshade0six Level 1 Level 1 (0 points)

    Thanks - Appreciate the recommendation.  I know I need to desperately upgrade - Just haven't made the time or efforts yet, but the all-to-consistent beachballing and your recommendation should force me to make the jump. : )

     

     

    Thank you again.

  • Network 23 Level 6 Level 6 (11,870 points)

    Nightshade0six wrote:

     

    I have 2GB RAM and run minimal apps.  Right now I have 188.48 MB available and am running Chrome, Terminal and Whatsize.  Earlier it was between 8-12 MB running the same apps plus or minus one (such as activity monitor).

    2GB is somewhat minimal on 10.6. As long as you ran minimal apps, you might not notice, but I'll bet you already had some swap files going with just 2GB RAM. I completely agree with the recommendation above to go to 4GB. I do graphics and Photoshop, so for me personally I won't buy a new Mac today with less than 8GB, but that might not apply to you.

     

    Nightshade0six wrote:

     

    I did however add a Virtual Box VM for Windows 7 a couple days ago - I don't see how, but could this be part of the issue?

    Oh dear.

     

    Adding a Windows virtual machine changes EVERYTHING. Not only do you have to run Mac OS X, but you also have to run VirtualBox, and on top of those two you must also meet the minimum system requirements of Windows. You must now meet a minimum configuration for running two complete operating systems simultaneously in only one computer, since Windows 7 is running inside Mac OS X. This is a recipe for exploding swap files, because you can't easily fit both Mac OS X and any recent version of Windows into just 2GB RAM. And that's before opening a RAM-hungry app in either OS.

     

    I have a lot more RAM in my Macs but I still see swap files increase when running Windows, since it's about booting up a whole other computer inside the same computer. If I'm already using up my RAM with Photoshop or other apps, I fully expect many more swap files to appear because I'm not leaving much RAM for a whole other OS to run.

     

    If you ran Windows in Boot Camp (i.e. booting the Mac into Windows alone), it would be less of a burden on the RAM, because only Windows would be running, as long as you don't mind not being able to use the Mac side. Or you could just add a bunch of RAM.

  • X423424X Level 6 Level 6 (14,205 points)

    I'm not familiar with VirtualBox which is why I didn't jump all over it in my earlier posts other than suggesting its removal due to continually running daemons (at least I think they are running).  But I am not sure it has a full windows system running inside it.  Only enough of an environment to support windows executables which I would hope (only hope) would be less than a full windows environment.  It's still though probably a memory hog.

Previous 1 2 Next