Child pages
  • Ramdisk Java

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At this point you have an existing JVM squashed in .sqsh file with a roughly size of 176M:

Code Block
languagebash
themeEmacs
user@machine:/media$ ls --block-size=M -al /usr/lib/jvm/ramdisk/java-1.8.0.91-oracle.sqsh 
-rw-r--r-- 1 user users 176M May 12 15:53 /usr/lib/jvm/ramdisk/java-1.8.0.91-oracle.sqsh

Mount Point

Create a mountpoint for the ramdisk:

...

Edit your /etc/fstab and define your mount point as a tmpfs by adding the following declarationdeclarations: 

Code Block
languagetext
# change the default size for the ramdisk
tmpfs /media/ramdisk-java-8-oracle tmpfs defaults,size=400M350M,mode=1777 0 0
/usr/lib/jvm/ramdisk/java-1.8.0.91-oracle.sqsh /media/ramdisk-java-8-oracle squashfs ro,defaults,loop 0 0

If you reboot at this point you will have a ramdisk of 400M defined at /media/ramdisk-java-8-oracle filled with your squashed JVM:

 

Code Block
languagebash
themeEmacs
user@machine:/media$ du -hs ramdisk-java-8-oracle/
349M ramdisk-java-8-oracle/

That way we know how correctly size what we need for our ramdisk. 350M for a java-1.8.0.91 from Oracle.