Create your own RAM Disk in OS X

ramdisk-0

RAM as you already know is the random access memory where a certain amount of data is stored that be residents in the same we can have them ready much earlier than if you had to read them from a traditional hard drive obviously, but the problem is that when there is a loss of power, this data disappears, either due to a power outage, a restart ...

In any case, it is an advantage to have more space where other programs like Photoshop can take advantage of it or to edit large video files so for a test server it can be a more than interesting option.

In particular, the RAMDisk does not provide a clear advantage over the RAM other than for store at any given time what we want, It is a way to configure a new storage device, as if we installed another hard disk that we will see with the finder, with the exception that the read / write speed will be overwhelming depending on the speed of the installed RAM if we compare it with an HDD traditional or even an SSD. Its usefulness does not go beyond what we want to give it, such as configuring the cache of a server in tests, as I have said before.

Through Terminal

The only thing to keep in mind when creating it is the appropriate size to allocate, keeping in mind the amount of RAM that we have since if we go over that amount, what can happen is that the system has to use the disk as an alternative, causing the waiting times when opening applications or loading files to increase exponentially, that is, the overall performance of the system will plummet.

The first method to create our RAMDisk is through the system terminal. With what we will open Applications> Utilities> terminal and we will introduce this command:

diskutil erasevolume HFS + 'RAMDisk' `hdiutil attach -nomount ram: // XXXXX`

Instead of XXXX we will write the amount to assign always is the Multiplication of Megabytes by 2048, so if we want 8Gb of RAM, we simply multiply (8192 * 2048) and it will give us an amount of 16777216 with what would be like this:

diskutil erasevolume HFS + 'RAMDisk' `hdiutil attach -nomount ram: // 16777216`

Also if you wish you can change the name of RAMDisk between the quotation marks for the one you want.

Through a Program 

If that of touching the terminal and inserting commands gives you «yuyu», the best thing is that you leave the task to a program that does exactly the same automatically without you having to intervene, this program is called RAMDiskCreator and we will only have to put the amount of storage in the box, nothing more.

ramdisk-1

More information - Scapple will organize your ideas like an organization chart


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   danillocezar said

    hello, I have a 4 GB RAM I have to create with the same memory?

    1.    Miguel Angel Juncos said

      I would advise you at least 8 GB installed in the system if you are with Lion or Mountain Lion and assign 2GB to the RAMDisk (at most 4Gb) but with 4Gb for the whole system it is a waste. Leave it as it is.

  2.   Astro said

    Joer, the article is very good, but you explain what the RAM is but not what the RAMdisk is, what is it for and what is the advantage of doing this operation ... You should complement the article because it really does not understand absolutely anything about what we want or we should do this ...

    1.    Miguel Angel Juncos said

      Thanks for the note. It is already updated and explained what a RAMDisk is, by means of a command to reserve a part of the RAM as a storage unit, it is not more. Its utility is whatever you want to give it, but it is a good option to do tests on servers, configure database queries through RAMDisk, I don't know ... it has the one you want ...

  3.   SNiPeR said

    I see it useful, but these things must be treated with care ... creating disk space for the ram is not a game and can overload the HD unnecessarily. It can be used as a torture as you say for PhotoShop, but theirs would be to finally increase the ram in case of needing more memory. Sometimes the Mac with 4GB, if you use many editor programs, you can stay a bit "just" to have the agility and speed that one would like. ! 🙂

    There is my opinion,
    Greetings.

  4.   robert said

    Hello, good morning, I'm mac, ask if I buy a 512 GB ssd to work faster with a heavy app would be a good recommendation

  5.   rabber said

    interesting article, thanks

  6.   Rafa Rafodia®  (@RafaRafodia) said

    How do I make the disk reboot at startup?