Re:Do not buy RAM, compress
by varenc on Friday November 20, 2026 @02:30PM
(#50580541)
I had a similar experience, but with Apple's APFS on-disk file compression! I accidentally generated a log file that just contains 300+ million lines of the same message repeated constantly. The log file was supposedly over 100GB in size, but I hadn't noticed my disk filling up. I investigate more, and discovered that APFS had compressed the file on my disk!
Apple's on-disk file compression is very mysterious, hard look up, and harder to intentionally trigger. The only clue in the Finder GUI is comparing the file size vs size on disk. Using the 3rd party `afsctool` you can tell APFS to compress a file on disk manually, but I believe there's no native macOS way to do this. The official way is that macOS decides for mysterious reasons when to compress a file on disk and it rarely does. But apparently generating a 100GB log file with million of repeated lines is enough to convince macOS to use APFS compression. (and having a disk that's nearly full probably)
Apple's on-disk file compression is very mysterious, hard look up, and harder to intentionally trigger. The only clue in the Finder GUI is comparing the file size vs size on disk. Using the 3rd party `afsctool` you can tell APFS to compress a file on disk manually, but I believe there's no native macOS way to do this. The official way is that macOS decides for mysterious reasons when to compress a file on disk and it rarely does. But apparently generating a 100GB log file with million of repeated lines is enough to convince macOS to use APFS compression. (and having a disk that's nearly full probably)