Optimize Use of Ramdisk for Eclipse Development

∥☆過路亽.° 提交于 2019-11-28 18:55:11

Here's what I did

Moved to the Ramdisk:

  • JDK (deleted some unnecessary files e.g. demos, src.zip)
  • Eclipse plugins directory
  • SpringSource work directory
  • SpringSource library directories

There's a neat trick that lets you move folders (or files for that matter) to the virtual disk without making a single change to configuration.

  1. Copy the folder to the Ramdisk
  2. Rename the original folder (I added -COPY to the end)
  3. Use the mklink /J command to make a link from the place on disk where the directory used to be before you renamed it to where you copied it on the Ramdisk

For example:

cd C:\Dev\Apps
Xcopy jdk R:\jdk\ /s
ren jdk jdk-COPY
mklink /J jdk R:\jdk

The Ramdisk I selected has an option to persist state upon system shutdown (assuming there is no crash). I elected to move only relatively static files onto the Ramdisk, so once I have one good reboot, I should always find my Ramdisk in the state I need it.

On pre-Vista machines you can substitute junction from SysInternals for mklink.

You can try to move your Eclipse workspace into a ram disk. I am pretty sure neither javac, nor Eclipse compiler are using any temp files, so it goes straight from the *.java files to *.class files plus copying resource files from source location into a target folder.

Another alternative you may want to consider is to use a solid state drive (SSD). You are going to see a significant performance improvements in many areas that are heavily reading and writing files from disk.

I am using the SoftPerfect RAM Disk software. I installed the JDK, Eclipse, Maven, Gradle, and Ant on it. Also my workspace, my development git repositories and the local Maven repository (all downloaded dependencies) are on the RAM drive. I also created a "user home" directory on the RAM drive and I changed eclipse.ini to point to this new "user home" directory. Performance has improved dramatically and Eclipse now starts up under 10 seconds. I documented my approach here:

http://www.whizu.org/articles/how-to-install-eclipse-on-a-ramdrive.whizu

I don't think move JDK and plugins folder to the ramdisk is a good solution for this case, since most time these IO is not the bottleneck for eclipse. I tried with your solution, and found that the workspace.metadata folder should be move to the ramdisk, that could help the build and execute speed. And if possible, you should move all your workspace folder under the ramdisk, and use some version control to ensure the data safe. Good luck.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!