0

I am using a 64 bit Windows 10 system with 32Gb of RAM. One of my 32 bit java application requires a lot of memory so I decided to change the minimum heap size to -Xms4096m at the runtime parameter field in the java configuration dialogue.

java configuration window

However, I soon realised that it would not do anything because apparently my system's maximum heap size is only 247.50mb (which is way too small for a 64 bit system). I am using a 32 bit java so I am expecting a max heap size of around 4GB. Can anyone tell me what determines the maximum heap size and how do I change it?

UPDATED: I understand that the maximum I can allocate is 2GB for a 32 bit system. So my question now is how come for my system, its only 247.50mb?

command prompt

BELOW ARE MY Java Settings:

enter image description here enter image description here

Xenos
  • 73
  • 2
  • 11
  • Possible duplicate of [Increasing the JVM maximum heap size for memory intensive applications](https://stackoverflow.com/questions/3030263/increasing-the-jvm-maximum-heap-size-for-memory-intensive-applications?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa) – ailav Mar 26 '18 at 11:14
  • Possible duplicate of [Increasing the JVM maximum heap size for memory intensive applications](https://stackoverflow.com/questions/3030263/increasing-the-jvm-maximum-heap-size-for-memory-intensive-applications) – Andrew Henle Mar 26 '18 at 11:16
  • 1
    In 32bit mode in fact you are able to use only 2GB (in modern patches about 3G) since another 2GB of virtual memory reserved by operating system for their needs. The best scenario for you case - run your java app in 64 bit JVM and this is it. 32-64 bit problem is mostly native (C/C++/ObjectiveC/ASM) issue. – Victor Gubin Mar 26 '18 at 11:17
  • *I am using a 32 bit java so I am expecting a max heap size of around 4GB.* That's not going to happen. Are you also expecting a visit from a unicorn? There's no way to put that much memory into a 32-bit process. – Andrew Henle Mar 26 '18 at 11:17
  • right..sorry. @AndrewHenle I understand that is exaggerated but why is the max heap size only 247.50? Maybe at least 1GB? – Xenos Mar 26 '18 at 11:33
  • Well it does say that it's *estimated*. 1GB is quite doable even on 32-bit VM. Why does the app require a 32-bit JVM though? – Kayaman Mar 26 '18 at 11:40
  • @Kayaman I didn't build the app, it is a 32 bit software that I bought. It uses a lot of graphic and become laggy when zooming in/out and sometimes went blank (the graphic turns back on if I minimise and maximise the window again). I have been told by the company to increase the heap size to -Xms4096 as stated but obviously thats not gonna happen. So I was hoping maybe -Xms1024? – Xenos Mar 26 '18 at 11:48
  • What's the output for `java -server -XshowSettings:all`? – Kayaman Mar 26 '18 at 12:03
  • @Kayaman Please see post re-edited – Xenos Mar 26 '18 at 12:09
  • I don't see the `-server` flag. – Kayaman Mar 26 '18 at 12:11
  • @Kayaman It said its missing. >java -server Error: missing `server' JVM at `C:\Program Files (x86)\Java\jre1.8.0_151\bin\server\jvm.dll'. Please install or use the JRE or JDK that contains these missing components. – Xenos Mar 26 '18 at 13:31
  • Ah, well you've got quite the setup there. Still, I'd try to verify that the heap really is that low. I wouldn't trust any estimates. One way to do that would be to run it in debug mode and use VisualVM to see the memory usage. – Kayaman Mar 26 '18 at 13:47

0 Answers0