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 be开发者_运维百科ing said, what would be a safe (without paging?) maximum heap size we can use, assuming this is the sole application running on the system?
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.
The best idea is to experiment... Check the first answer here... it will help you...
You can write a batch file to do experiment for different heap sizes and see where it crashes...
If you have two memory banks e.g. as you have two CPUs, you may find that your application performance is significantly slower if you use more than half your memory. You will get the best performance from your memory if you use about 3/4 of your memory bank size.
You may still get better performance for using more of your memory, but it won't scale the way you might expect and your GC times will jump significantly.
精彩评论