Search code examples
javawindowsmemory64-bitheap-memory

What is the maximum Java heap size I can use safely on Windows 64-bit platform?


We use Windows 2003 server 64-bit for running a WebSphere/J2EE application (JVM is also 64-bit). The machine has 16GB physical memory. It's unfortunately that our application is memory-intensive, and it would still take some time for us to add additional memory.

I understand operating system itself requires certain amount of memory. That being said, what would be a safe (without paging?) maximum heap size we can use, assuming this is the sole application running on the system?


Solution

  • I think that the answer will depend on many factors, many of which are hard to predict.

    IMO, the most practical way to determine the safe max heap size is by trial and error. I'd start with a max heap size of around 15Gb, look at the system's memory / paging stats, and adjust up or down.