Tomcat: adjust memory proportions

隐身守侯 提交于 2019-11-29 15:32:46
Michael

Your issue was probably OS related, not Tomcat / Java. The Windows OS limits the memory allocation of a 32-bit process to 2 GiB in total (by default).

The reason why it only allowed you to allocate around 1.5 GiB heap space is because there is also other memory allocated to the process (the JVM / library overhead, perm gen space etc.).

Why does 32-bit Windows impose a 2 GB process address space limit, but 64-bit Windows impose a 4GB limit?

Other modern operating systems [cough Linux] allow 32-bit processes to use all (or most) of the 4 GiB addressable space.

That said, 64-bit Windows OS's can be configured to increase the limit of 32-bit processes to 4 GiB (3 GiB on 32-bit):

http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx

However, as you've rightly done, the best solution is to use a 64-bit JVM with your 64-bit OS. Terabyte heaps anyone:

Max memory for 64bit Java :D

Despite having a 64 bit server I only had 32 bit Java/Tomcat installed. I uninstalled Java and Tomcat and installed 64 bit versions and everything worked fine. it seems that the issue was that 32 bit Java can only address 1.5 GB.

Thanks, Rik

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!