Is /tmp a RAM disk or does it use the local SSD?

I'm looking to run a script that generates a temporary 8GB file which is subsequently deleted when the script is finished. I have thousands of these to do and I don't want to wear out my SSD by writing over 100TB of temporary files to it so I'd like to create these files in RAM instead. I've heard that some Linux distros have /tmp as a RAM disk but I'm not sure if that is the case for Big Sur, and if so if it's big enough to hold an 8GB file. Anybody know the answer, or possibly have an alternate solution for me?

MacBook Pro 16″, macOS 11.4

Posted on Jul 6, 2021 6:41 AM

Reply

Similar questions

2 replies

Jul 6, 2021 7:02 AM in response to Mick_M

/tmp is just a regular directory on the drive like any other. I'm not even sure if a RAM disk would be possible anymore since opening the file would almost certainly using mmap() at a low level, which would leverage the VM system to speed up disk I/O. But that would put the file back on the SSD. It would only be the final write that would move it into place on the RAM disk.


But regardless, here are instructions from OWC on how to create a RAM disk: https://eshop.macsales.com/blog/46348-how-to-create-and-use-a-ram-disk-with-your-mac-warnings-included/


I haven't tried these instructions. What I do is rent a Mac mini in a data centre for this kind of work.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Is /tmp a RAM disk or does it use the local SSD?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.