Find temporary files in OS X


When a backup volume is not mounted, Time Machine has saved hourly snapshots to /Volumes/MobileBackups/ on laptops since 10.7. They are deleted automatically when you start running out of disk space though.

/private/var/folders/ can contain partially downloaded files or files for applications that have been removed. du -sm /private/var/folders/*/*/*/*/ | sort -rn sorts the folders by size.

~/Library/Autosave Information/ can contain old unsaved documents.

~/Library/Caches/ Previews/ was about 700 GB on my installation of 10.7. defaults write DebugSnapshotsUpdatePolicy -int 2 disables saving the thumbnails.

Safari saves the contents of websites and plain text files to ~/Library/Caches/Metadata/Safari/History/.

If hibernatemode is 3, /var/vm/sleepimage takes up the same amount of disk space as the amount of RAM you have.

/Library/Developer/ wasn’t removed when I installed Xcode 4.3. It contained about 2GB of old docset files.

A good way to find large files is to sort files by size in list view after checking calculate all sizes in the view options. You can show hidden files with defaults write AppleShowAllFiles -bool true; killall Finder.

Posted in osx86 tips. No Comments »

Linux CentOS low on memory – how to tell which user is sucking RAM

To see what users are sucking RAM:

smem -u and smem -u -p tell you exactly which user is using RAM.

Get smem here:

To see available cached RAM:

If all your memory is getting used, take a closer look to see which memory is being sucked up by disk cache and is actually available instantly to any app that needs it:

free -m or watch free -m to constantly monitor your RAM usage.


root@niagra [~]# free -m
total       used       free     shared    buffers     cached
Mem:         32101      30831       1270          0        640      27716
-/+ buffers/cache:       2473      29627
Swap:         8191          0       8191

That bolded number is actually what’s available at any time instantaneously.
It’s in the row “+/- buffers/cache” under the column “free”

Memory that is You’d call it Linux calls it
taken by applications Used Used
available for applications, and used for something Free Used
not used for anything Free Free

To release cached memory and get your RAM back:

echo 3 | sudo tee /proc/sys/vm/drop_caches

Then wait 3 seconds and run free -m again, you’ll see the memory was released from cache but this should not be necessary since the column “free” showing on “+/- buffers/cache” didn’t change much.

I also use a variation of “top” called “mem”, it’s an RPM that must be installed.

To turn swap on or off: sudo swapoff -a and sudo swapon -a

To see everything about your RAM: sudo dmidecode -t 17

Posted in Server tips. No Comments »