The Trash is just a special folder (directory) that Apple creates and manages via the Finder so that you have some ability to easily "undelete" items (by removing them from the Trash) before you full-on delete (Empty Trash). Since this mechanism is just a directory on your startup disk, you technically have your entire startup disk's space to use up for Trash if you wanted to.
If you wanted some measure of "auto-magical" removal files older than 7 days, you can use a simple bash script:
find ~/.Trash -mtime +7 -exec /bin/rm -rf {} \;
Using your favorite text editor, paste the above line into a new file and then save the file as empty_trash_older_than_7_days.sh
. In the terminal, be sure to use the chmod
command to make it executable as such: chmod +x /path/to/empty_trash_older_than_7_days.sh
This command, when executed in the terminal, will find all the files in your Trash (files from your Startup volume only --more on this in a minute) that are older than 7 days (from the time you run this command) and pass each file to the rm -rf
command. Since rm
is a unix command and has no notion of the Trash, it just does a unix delete which for our purposes is real delete (like Emptying the Trash).
You could then use cron (if you are unfamiliar with Cron, check out the fine Cron entry on wikipedia) to setup a recurring execution of this script.
Personally, my vote is to just train yourself to use the Empty Trash
menu item every few minutes, days, weeks?
P.S. if all this unix-ese is too frightening, I'd wager there are simple Mac Applications that people have written to do just this sort of thing. Hopefully someone with some knowledge of one ore more of these types of applications can offer up an answer or two as a counter balance.
Good luck!
P.S. I forgot to talk about the non-startup volume... If you delete a file from a volume OTHER than your startup volume, this file will go to the .Trash folder on that volume. For example, if you had a volume named Foo
, there would be a .Trash folder at /Volumes/Foo/.Trash
. What I have documented above will not delete those files. You'd have to setup something similar for each volume you have.
wonder why one would want to disable the swap file in Mac OS X.
Does it increase performance? Stability?
Any downsides?
I suppose people would do it for an SSD drive because those drives don't have the same lifetime as standard magnetic spinning-disk drives. There are a more limited number of write cycles, so presumably using them with a swap file would use up these cycles more quickly.
Finally, does it make any sense to disable swap file when not using SSD?
If you have a lot of RAM, this would possibly speed up performance, but it's not a good idea in general. If you do run up against the memory ceiling, things are going to get flaky.
Also, wired memory isn't released when it becomes invalid, it is only released when a page out event is triggered, which won't happen if Virtual Memory is disabled. So it won't take long for all your memory to be gobbled up even if it is no longer used.
Best Answer
Yes you can configure the
dynamic_pager
, but for most it is simpler to just disable it and see which program crashes due to the inevitable out of memory errors.Why would I disable swap file in Mac OS X?
Pay attention to programs that implement their own virtual memory / cache / paging systems like virtualization and the Adobe Suite in case you have inadvertently tuned them to use more RAM than is available on the system. They tend to be first on my investigation list when I see a mac with runaway swap allocation on the filesystem.