Sunday, December 11, 2016

Freeing up memory for JDeveloper 12c on Windows platform

Environment / Assumptions in this post:
  • Windows 7
  • JDeveloper 12c
  • SQLDeveloper 4.1

When I got a new desktop at work, it was one of those tiny but powerful units that sits mounted behind your monitor. It had a 128Gb SSD, which is small but should be enough for a Windows 7 Enterprise install with just a few productivity tools.

Or so I thought. It turns out that at least two if not three versions of JDeveloper, SQLDeveloper, Cygwin, plus all the usual browsers and Office suite tools takes up lots of space. Plus the projects. I was having to keep things pretty lean to stay afloat from a space point of view. I was constantly having to empty the recycle bin and tmp folders, but it was quickly becoming apparent that those actions were not going to be enough.

So after a bit of digging around, I came up with a short list of things to do that I passed on to my co-worker developers. These may not all apply to other Windows versions and some of these you will want to approach with caution.

I would install WinDirStat – very good Open Source program inspired by the KDirStat Linux utility (update: KDirStat is dead, it is now QDirStat). Make sure to run it on c: only.  It will tell you which folders are taking up how much space, which is really useful to find those hidden hogging directories.

Stuff to Delete

  • If you run the Integrated Weblogic in JDeveloper, you may end up with lots of artifacts from deploying. You can try checking in your ...\AppData\Roaming folder, similar to this:
    C:\Users\jjames\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\DefaultDomainYou can delete the logs and tmp folders at the very least. Don't forget that you can do this for each of your Middleware Homes.
     
  • Delete from Trash Bin, and make sure it isn’t sized too big.
     
  • Delete the various Temp folders, especially under c:\Windows.
     
  • Uninstall programs that are not needed(!).
     
  • Turn off “System Protection”. Do this at your own risk! Go to System Properties / System Protection / Configure.
     
  • Look for HPROF files these are java heap dumps. They can be very big, and you can get them when for example an Oracle product does a thread dump. You can examine them with JVisualVM, or there is a great tool called MAT (an Eclipse project). They are usually under….can’t remember if it was ORACLE_HOME or if it was under ROAMING. I had a few of them.
     
  • There is a big folder c:\Windows\Logs\CBS.  Turns out this takes up an artificially high amount of space, because of the way hard links are accounted for in Windows. This can be trimmed by running the “Disk Cleanup” wizard, start it up and click “Clean System Files”. It will add a few more checkboxes to the list. This can take a while.
     
  • Finally, you can disable Hibernate. This probably isn’t needed for desktops. Proceed at your own risk here too. Run a cmd shell with Admin, then type:

    powercfg.exe /hibernate off