What's this vm folder...

Joined
Jan 14, 2016
Messages
51
Reaction score
6
Points
8
Location
Santa Cruz Mtns foothills, Cupertino, CA
Your Mac's Specs
Mac Mini 16GB/1TB, two 4K monitors/Mojave, Mac Book/Catalina, 2nd Mini in TV room for games/surfing
on my hard drive? It has a 1.07 GB text file called swapfile0 that I'm not allowed, for some reason, to open.

I'm tight on memory -- can I get rid of this thing?
 
Joined
May 21, 2012
Messages
10,747
Reaction score
1,196
Points
113
Location
Rhode Island
Your Mac's Specs
M1 Mac Studio, 11" iPad Pro 3rd Gen, iPhone 13 Pro Max, Watch Series 7, AirPods Pro
When you say memory, do you mean hard drive space, or ram?
 
OP
I
Joined
Jan 14, 2016
Messages
51
Reaction score
6
Points
8
Location
Santa Cruz Mtns foothills, Cupertino, CA
Your Mac's Specs
Mac Mini 16GB/1TB, two 4K monitors/Mojave, Mac Book/Catalina, 2nd Mini in TV room for games/surfing
hard drive space
 
Joined
Oct 16, 2010
Messages
17,542
Reaction score
1,576
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2011 27" iMac, 1TB(partitioned) SSD, 20GB, OS X 10.11.6 El Capitan
on my hard drive? It has a 1.07 GB text file called swapfile0 that I'm not allowed, for some reason, to open.

I'm tight on memory -- can I get rid of this thing?


Doing some reading here:
What is the purpose of this vm folder? - Mac OS

and here:
mac what is swapfile0 - Google Search

If your hard drive space is getting so low that a file just over 1 GB needs to be deleted, it's already too full for normal use and you may start having drive space related problems if you aren't already experiencing them.

And BTW: a swapfile is often generated when your computer is running low on memory and it starts storing things on Disk (part of virtual memory).




- Patrick
======
 
Joined
Feb 1, 2011
Messages
4,435
Reaction score
2,153
Points
113
Location
Sacramento, California
on my hard drive? It has a 1.07 GB text file called swapfile0 that I'm not allowed, for some reason, to open.

I'm tight on memory -- can I get rid of this thing?

It sounds like a virtual memory swap file. You aren't being allowed to open it because the Macintosh makes it hard to mess with files that you shouldn't be touching. Namely system files. I could tell you how to flush your virtual memory, but that doesn't seem like a good idea. You have virtual memory files for a reason,and they get flushed as necessary.

You can use any of these programs to locate large files/unused programs for possible deletion. They all work a bit differently, so feel free to try more than one:

DiskInventory X (free)
Disk Inventory X

GrandPerspective (free)
GrandPerspective

OmniDiskSweeper (free)
OmniDiskSweeper, OmniWeb, and OmniPresence - The Omni Group

So....what I recommend that you do depends on why you are running low on free hard drive space.

If you are running low on free hard drive space because you recently had plenty, and now it has filled up quickly for no reason, this is a problem that I can help you with. It's like an out-of-control log or cache file and it can be a bit of a pain to pin down and fix. Let me know if this is the problem, and I can help with it.

You may want to run this to temporarily forestall the problem:

Maintenance (free)
Titanium Software | Operating system utilities for Mac - Maintenance

If you are running low on free space simply because you don't have a big enough hard drive and you've filled it up, I don't recommend that you go mucking about deleting things that you don't understand. Now is the time to go and purchase an external hard drive and start offloading things from your main drive to it. If you allow your main drive to remain too full, even if you delete a few things, you risk having your Mac starting to run flaky, because Mac's need about 20% free space on your hard drive to use for things like databases, scratch space, caches, virtual memory, etc. And that space needs to be contiguous space on a rotating disk hard drive, not fragmented space.

See:
OS X Maintenance And Troubleshooting
Item #5 and Note #1
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,771
Reaction score
2,111
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
If you are tight hard disk space, you should be clearing files first and foremost in your home folder, do NOT look elsewhere. The ONLY other place that you should look after that is the /Applications folder to see if you can delete any unused apps.

If you can't delete files to make space, then get an external drive and move all of your files to that and leave your internal storage just for applications and OS stuff.
 
OP
I
Joined
Jan 14, 2016
Messages
51
Reaction score
6
Points
8
Location
Santa Cruz Mtns foothills, Cupertino, CA
Your Mac's Specs
Mac Mini 16GB/1TB, two 4K monitors/Mojave, Mac Book/Catalina, 2nd Mini in TV room for games/surfing
Got it, thanks.

I do have an external HD that is dedicated to Time Machine. I can move some little-used files there.

Mainly I was just wondering what the vm thing was. I searched on this site's search line before asking, but didn't understand what I found.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,771
Reaction score
2,111
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Gotcha.

Well let me give you a quick explanation. Your system uses the available system memory (RAM) as a holding area for things being operated on by the OS or applications. This is transient and meant to be temporary. Anything permanent goes to the storage (HDD, SSD, etc.).

When you have a machine with limited system memory but lots of demands from many applications running, the OS needs to "augment" this memory somehow. There are many different ways of doing this. One option in the more recent versions of macOS is to compress data in system memory that hasn't been accessed recently but know will be. That makes room for other data to be stored.

But this doesn't work in every situation and there will come a time when there isn't enough system memory to fulfill the requests from applications, so the OS will "swap" out the old data to storage to make space. However, it's entirely possible that the swapped out data could be asked for at any time and it's expensive to load it from scratch like was done initially. So, rather, the OS basically dumps out a number of pages of data as it was sitting in memory to a file it wholly controls and that's the swap file. That way, when the future request comes in, it can reload those swapped out pages quickly back into memory and it's ready to go without any additional work.

Where you end up with issues is when you are running on a system with very little memory, say 4GB of memory and have apps (like photo/video editing) that want large files loaded. Since there isn't enough system memory available to accommodate this, the OS will constantly swap in and out the pieces of data it needs to make the app work and beat up on the storage at the same time.

If you look at Activity Monitor and depending on the version of OS, if you see high Swap In/Out or Swap Used values, then you are in a situation where your machine could benefit from more memory based on your workflow.

Additionally, since the swap file is sitting on your storage, if you run low on storage with other data, you end up with REALLY bad performance to crashes since the OS can't swap anything to the storage but the demands of memory are constantly being made.

Hope that helps.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top