DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • How to Build Real-Time BI Systems: Architecture, Code, and Best Practices
  • How To Build Resilient Microservices Using Circuit Breakers and Retries: A Developer’s Guide To Surviving
  • Accelerating Debugging in Integration Testing: An Efficient Search-Based Workflow for Impact Localization
  • MLOps: How to Build a Toolkit to Boost AI Project Performance

Trending

  • Memory Leak Due to Time-Taking finalize() Method
  • Developers Beware: Slopsquatting and Vibe Coding Can Increase Risk of AI-Powered Attacks
  • The Full-Stack Developer's Blind Spot: Why Data Cleansing Shouldn't Be an Afterthought
  • Integrating Model Context Protocol (MCP) With Microsoft Copilot Studio AI Agents

Accelerating Build Using a RAM Disk

Learn how to speed up your build time using RAM memory as a filesystem, on Windows or Linux, in this quick tutorial.

By 
Dmitry Egorov user avatar
Dmitry Egorov
DZone Core CORE ·
May. 22, 18 · Tutorial
Likes (11)
Comment
Save
Tweet
Share
25.6K Views

Join the DZone community and get the full member experience.

Join For Free

Yes, RAM memory can be used as a filesystem! RAM memory, in comparison with a regular drive, has these advantages:

  • Fast IO operations
  • Fast search operations
  • Less number of junks
  • Reduced fragmentations
  • No noise or heat

But, of course, it has disadvantages:

  • Losing memory on reboot
  • High price
  • Size limit

When Is Sacrificing RAM Memory Reasonable?

  • To decrease the time of your builds/compilers.
  • To speed up your database.
  • Cache, cache, cache.
  • To accelerate heavy applications like CAD, development IDEs, or even games.

Windows RAM Drive Applications

  • ImDisk Virtual Disk Driver
  • SoftPerfect RAM Disk
  • Dataram RAMDisk

Linux RAM Drive

To allocate RAM in Linux, you need to take two steps:

Create a folder:

 mkdir /mnt/myramfolder

Mount RAM:

mount -t [TYPE] -o size=[SIZE] [FSTYPE] [MOUNTPOINT]


Now, let's take a look at an example.

Using RAM Memory to Speed Up Build in Java Maven-Based Projects

Allocating 2GB disk using ImDisk application and mount it to G disk:

Image title

Fetching a random Java project from GitHub (Guava): https://github.com/google/guava.

Building that project using the Maven command:

mvn clean install -DskipTests -Dmaven.javadoc.skip=true

Checking the results with a hard drive very performant SSD: Samsung EVO 960 (2GB/3GB read/write speed).

Image title

Building the Project Using a RAM Disk

Put an .m2 Maven repository and Guava project in a RAM drive. Maven requires you to change the .m2 location in settings file to <localRepository>G:/.m2</localRepository>.

Image title

Check the Build Time in RAM

Image title

Results: the RAM disk saved 37% of the build time.

That's pretty good, considering that we are comparing a very performant SSD with regular RAM. Results should be better for non-SSD hard drives. If we go deeper, then the next step is to put the whole Linux machine in RAM.

How to Save Your RAM Disk Before Reboot

In Windows, ImDisk provides a storing feature from the box.

In Linux, you need to write a small script with recursive saving files, like so:

cp -avr /mnt/myramfolder /tmp/myrambackup
Build (game engine)

Published at DZone with permission of Dmitry Egorov. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Build Real-Time BI Systems: Architecture, Code, and Best Practices
  • How To Build Resilient Microservices Using Circuit Breakers and Retries: A Developer’s Guide To Surviving
  • Accelerating Debugging in Integration Testing: An Efficient Search-Based Workflow for Impact Localization
  • MLOps: How to Build a Toolkit to Boost AI Project Performance

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!