Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
283 views
in Technique[技术] by (71.8m points)

ramdrive - Optimize Use of Ramdisk for Eclipse Development

We're developing Java/SpringSource applications with Eclipse on 32-bit Vista machines with 4GB RAM. The OS exposes roughly 3.3GB of RAM due to reservations for hardware etc. in the virtual address space. I came across several Ramdisk drivers that can create a virtual disk from the OS-hidden RAM and am looking for suggestions how best to use the 740MB virtual disk to speed development in our environment.

The slowest part of development for us is compiling as well as launching SpringSource dm Server.

One option is to configure Vista to swap to the Ramdisk. That works, and noticeably speeds up development in low memory situations. However, the 3.3GB available to the OS is often sufficient and there are many situations where we do not use the swap file(s) much.

Another option is to use the Ramdisk as a location for temporary files. Using the Vista mklink command, I created a hard link from where the SpringSource dm Server's work area normally resides to the Ramdisk. That significantly improves server startup times but does nothing for compile times. There are roughly 500MB still free on the Ramdisk when the work directory is fully utilized, so room for plenty more.

What other files/directories might be candidates to place on the Ramdisk? Eclipse-related files? (Parts of) the JDK?

Is there a free/open source tool for Vista that will show me which files are used most frequently during a period of time to reduce the guesswork?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:DevApps
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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...