Old Emmanuel Oga's Weblog (new one is at www.emmanueloga.com)

Slow Netbeans? Some tips I tried

Posted in ubuntu, Uncategorized by emmanueloga on marzo 20, 2008

UPDATE: tweak Netbeans configuration file.

Yeah NB can be slow sometimes. If you have some spare RAM megabytes you can make use of this old trick. I remember using this same trick to speed up Quake execution on ms-dos馃檪.

  • Uninstall Netbeans
  • sudo mkdir /media/ramdisk
  • sudo mount -t tmpfs none /media/ramdisk
  • Then install netbeans to /media/ramdisk

That’s all馃檪

Off course, you will need a decent amount of ram. Netbeans uses like 95mb of disk for version 6.0.1 (linux)

I found that tmpfs writes its contents to the directory it was mounted to once you unmount it, so it should persist its contents between system boots! I just needed to update /etc/fstab with this line: “tmpfs /media/ramdisk tmpfs”

    For Windoze, you should google for ramdisk support. I can’t get precise measures on the gain in performance, but I found that installing NB to ram really speeds things up. Now I should try to install the whole ruby interpreter in my ramdisk ….

    UPDATE:

    Amit Kumar Saha pointed out that tmpfs does not keep its contents to the disk on reboot. He is right. I manually unmounted the ram disk an it _did_ keep its contents to the disk, so I thought it was going to keep the contents also when booting. But when I did boot my pc, it didn’t work the same. To work around this, I did a tar package of my installation:

    • cd /media/ramdisk
    • tar cvvzf /home/emmanuel/tar/nb601.tar.gz netbeans-6.0.1/

    Then added this line to my /etc/rc.local:

    • tar xvvzf /home/emmanuel/tar/nb601.tar.gz -C /media/ramdisk

    That surely worked on reboot. Off course I will have to create the tar again everytime I change something in the ramdisk.

    8 comentarios

    Subscribe to comments with RSS.

    1. Amit Kumar Saha said, on marzo 20, 2008 at 5:45 am

      Hi!

      I am Amit K. Saha and the NetBeans community docs co-ordinator. Your post could make an interesting read on the NetBeans community docs wiki at
      http://wiki.netbeans.org/wiki/view/CommunityDocs

      So please consider contributing this post to the wiki. Or if you are busy, I can do that for you.

      Just drop me a mail at the address given above.

      Thanks and I look forward to seeing your contribution.

    2. Amit Kumar Saha said, on marzo 20, 2008 at 11:59 am

      It doesn;t seem to work馃槮

      ‘tmpfs’ *do not* preserve its contents. I created the ramdisk and wrote a simple file to it and after rebooting, it was gone!

      I am using a 2.6 kernel, also read http://www.ibm.com/developerworks/library/l-fs3.html

    3. Brian Mosher said, on abril 10, 2008 at 3:31 pm

      Have a look at the squash filesystem they are used by DSL, Knopixx, etc… you could rig up a seperate mount to use this and it will be read into memory on boot andretain it’s data after restart.

    4. Scabrously said, on junio 19, 2008 at 4:33 pm

      Somehow i missed the point. Probably lost in translation馃檪 Anyway … nice blog to visit.

      cheers, Scabrously

    5. Alex said, on noviembre 4, 2008 at 4:43 am

      It’s worth noting that this will only help NetBeans load its files (jars, etc) faster, and then only if your operating system wouldn’t have had them in its disk cache already. If you have lots of spare memory and you run NB fairly often, it probably already does.

      To demonstrate this, unmount the ramdisk you had NB on, then do the following:

      1. Start NB.
      2. Close NB.
      3. Start NB again.

      Unless memory is really tight on your machine, the second startup should be a lot quicker. The disk cache is the main reason for this.

      If you use a ramdisk, you’re basically second-guessing your OS by forcibly preloading those files, even if they’re only rarely used or not used at all, and never allowing it to use the memory for something potentially more useful.

      Of course, this can (and, in your tests, apparently does) still work out in your favor if you really do know better than whatever algorithms your OS uses to decide what to keep cached. Just remember that you’re making a trade-off between explicitly preloading what you know you need and caching what you don’t know you need.

      On Linux, the command-line tool ‘slabtop’ can be used to see what kind of items your kernel is caching, and in what proportions. I don’t know of any way to see which files are being cached, though.

      An alternative to ramdisks might be to use some sort of adaptive preloading daemon, like preload or Windows Vista’s Superfetch. Unfortunately, in my experience, these produce no noticeable performance improvement. They also seem to actually hurt performance, apparently because they consume lots of memory and make the OS start swapping, which is much worse for performance than no preloading at all.

    6. Danny said, on julio 29, 2009 at 12:45 pm

      Extracting NB on every boot? Doesn’t make sense. Better idea is to rsync local folder with ramdisk

      • emmanueloga said, on julio 29, 2009 at 2:00 pm

        yeah actually I have not investigated much more in this field cause I switched to vim for now. What I can say is that Netbeans is definitely a great ide, but too slow for my tastes most of the times. What I really would like to see is NB compiled with something like http://www.excelsior-usa.com/jet.html or even http://gcc.gnu.org/java/. Alas, I don’t think I will ever see something like that.


    Responder

    Introduce tus datos o haz clic en un icono para iniciar sesi贸n:

    Logo de WordPress.com

    Est谩s comentando usando tu cuenta de WordPress.com. Cerrar sesi贸n / Cambiar )

    Imagen de Twitter

    Est谩s comentando usando tu cuenta de Twitter. Cerrar sesi贸n / Cambiar )

    Foto de Facebook

    Est谩s comentando usando tu cuenta de Facebook. Cerrar sesi贸n / Cambiar )

    Google+ photo

    Est谩s comentando usando tu cuenta de Google+. Cerrar sesi贸n / Cambiar )

    Conectando a %s

    A %d blogueros les gusta esto: