Macintosh HD/vm/swapfile0: safe to delete?

ACD0236

macrumors member
Original poster
Nov 2, 2016
60
38
Hi there,

I just setup a new MacBook Pro. Besides the usual folders like Library, System, Applications and Users I found vm which contains a 1.07 GB file named swapfile0. Would it be safe to delete this, in your opinion?

Thank you very much in advance!
 

chabig

macrumors 604
Sep 6, 2002
6,741
3,956
Absolutely not! That file is used by the system to maintain virtual memory. So first off, you shouldn't delete it. Second, you probably can't. If you somehow manage to do so you'll probably crash the machine with a kernel panic. Then it would reboot just fine and recreate the file if it needs to.

See https://en.wikipedia.org/wiki/Virtual_memory
 
  • Like
Reactions: ACD0236

ACD0236

macrumors member
Original poster
Nov 2, 2016
60
38
That's what I thought, but shouldn't the swap files be located under /private/var/vm? Just curious about this.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
30,333
10,094
California
Hi there,

I just setup a new MacBook Pro. Besides the usual folders like Library, System, Applications and Users I found vm which contains a 1.07 GB file named swapfile0. Would it be safe to delete this, in your opinion?

Thank you very much in advance!
I had that same folder/file appear out of nowhere. I backed up first then deleted the folder and rebooted and it never came back and caused no problems. I have no idea what caused it. I think it might have been the Mojave installer, but I'm not sure because I rarely look in that root folder.

As you mentioned, this is not the normal and hidden swap file location.
 
  • Like
Reactions: matisan

ACD0236

macrumors member
Original poster
Nov 2, 2016
60
38
Thank you for your input, I'll then proceed to delete it.
 

ttthhhxxx

macrumors newbie
Feb 23, 2020
1
0
Thank you for your input, I'll then proceed to delete it.
Hi, excuse me, I would wonder whether there is any problem after that you deject that.
I have both macOS and windows system in my MacBook, and when I update the macOS system to macOS Catalina from Mojave , the swapfile0. come up.
I don't know how it work, and does it relate to the virtual space about windows system?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.