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

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

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • MLOps: How to Build a Toolkit to Boost AI Project Performance
  • Snowflake Empowers Developers to Easily Build Data-Driven Apps and Chatbots
  • 6 Best Practices to Build Data Pipelines
  • How To Build a Financial App With Proactive Security Measures

Trending

  • How the Go Runtime Preempts Goroutines for Efficient Concurrency
  • Mastering Fluent Bit: Installing and Configuring Fluent Bit on Kubernetes (Part 3)
  • While Performing Dependency Selection, I Avoid the Loss Of Sleep From Node.js Libraries' Dangers
  • A Guide to Developing Large Language Models Part 1: Pretraining

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

  • MLOps: How to Build a Toolkit to Boost AI Project Performance
  • Snowflake Empowers Developers to Easily Build Data-Driven Apps and Chatbots
  • 6 Best Practices to Build Data Pipelines
  • How To Build a Financial App With Proactive Security Measures

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!