Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm worse than my grandmother when it comes to computers. So I got a Mac as my friends who know me and know a bit about PCs said I'd fair better with a Mac. They were right and I love my Mac Book Air.

But I noticed over the last couple of days that everything was running a LOT slower and that my Microsoft Excel & Powerpoint each crashed twice (which otherwise NEVER happens -- have owned it for 2 years).

In trying to clean up some files, I foolishly deleted swapfiles, as I was worried I had downloaded some mega files (6 files, each over 1 Gb!) from the internet (although I am cautious when it comes to downloading anything!).

Of course only after the fact did I poke around on some forums and saw that these files seem pretty important to the running of the system.

How can I get them Back? Will they just come back once I start using my Mac again? I also have a Time Machine backup, so should I look there? I"d rather avoide re-booting everything if possible.

FOLLOW-UP: Thanks for the answers below! I will INDEED be more cautious in the future! Real quick: re-boot is the same as re-start, correct? I hope it is, because I'm not sure if I have all the software to re-install everything. Please let me know; thanks again!

2nd FOLLOW UP: If I have to re-boot, do you think a safe boot would suffice? Would that mean I could avoid having to re-install software, e.g., Word & Powerpoint?

3rd FOLLOW-UP: If the swap files again get SO big, will re-starting the computer clear them?

Apologies that my questions are sort of pathetic -- I probably shouldn't be allowed to touch a computer ;-)

share|improve this question
    
Your question has already been answered. But just for your knowledge. It is true that swap file can get pretty big. They are intended to do so. They store important application states when your RAM (the place where application states are usually stored) is full. When apps getting closed the space in RAM/swap-files is freed. This is a dynamic process. In the future I can recommend you to do not delete ANY files you don't put on your system, especially when they are not in your home folder. When your system is getting slower ask somebody (or in this place) what you can do against it. We'll help. –  cyphorious Nov 15 '12 at 12:39
2  
Reboot and restart are synonyms and used interchangeably. –  CyberSkull Nov 15 '12 at 18:01
    
If you reboot you will not have to re-install anything. Just turn your computer off and on again. That's all. And yes, the swap file will get big again, but remember: this is a feature not a bug. A reboot will for sure clean them again - as stated in the answer. –  cyphorious Nov 15 '12 at 18:24

1 Answer 1

To re-create swap files, you should restart the Mac (a normal shutdown is all that's needed). Swap files get cleaned up each and every reboot whether you attempted to mess with them or not.

I used the word attempted since you can't really delete a swap file from under the system due to how unix (the underpinnings of Mac OS X) works. The best you can do is remove the entry in the filesystem that points to the swap file, but any file doesn't get deleted until all files that were using the file are done with it.

Since swap files contain the state of the machine while running, they are marked to not be backed up since they change from second to second and get recreated each boot. To back them up would simply waste space on the backup and time of the system.

You picked a good system file to delete - next time be sure to ask first before deleting other files since many system files are not as forgiving when you delete them from a system and then reboot things.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.