Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, July 15, 2019 7:45 PM
Hi,
We are running a Windows 10 64-bit version in a VMware environment and we have installed OpenJDK 1.8 32-bit. When we launch a 32-bit app we depend on we get the good old could not reserve enough space error. I checked the default setting using java -XX:+PrintFlagsFinal and found the default MaxHeapSize was set to 700MB and the app we require needs 1GB.
So, I tried setting _JAVA_OPTIONS to -Xmx1024m and it still fails. As a test I ran "java -Xmx1024m -version" from the command line and it fails too. If I run "java -Xmx512m -version" it succeeds. It's almost as if I can't set the max heap size to anything above 700MB. How to I get it to 1GB so the java app we require launches?
Thanks,
-Mike
All replies (6)
Tuesday, July 16, 2019 2:42 AM
Hi,
If you want to increase your heap space, you can use java -Xms<initial heap size> -Xmx<maximum heap size> on the command line.
Profiling your application to find out why your heap size is being eaten.
AV program may reserving a small block of memory in every address space, thereby preventing a single really large allocation. You could check your anti-virus product.
You may refer to the following link for more solutions:
https://stackoverflow.com/questions/1596009/java-lang-outofmemoryerror-java-heap-space
https://blogs.vmware.com/apps/2011/06/taking-a-closer-look-at-sizing-the-java-process.html
Note: This is a third-party link and we do not have any guarantees on this website. And Microsoft does not make any guarantees about the content.
Best Regards,
Farena
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Tuesday, July 16, 2019 1:09 PM
Hi,
My heap isn't being eaten I just can set my heap size to anything larger than the default 700MB. I do use the -Xmx<maximum heap size> on the command line and it fails unless I use a heap size under 700 MB. Is there something on Windows 10 that is preventing me from increasing my heap size?
Thanks,
-Mike
Wednesday, July 17, 2019 8:22 AM
Hi,
As far as I know, You can increase to 4GB on a 32 bit system. Windows 10 will be the same.
You can monitor the available memory using vm flags "-XX+PrintFlagsFinal | grep -iE HeapSize" will tell you the maximum available heap size that can be used.
For your reference:
https://stackoverflow.com/questions/1565388/increase-heap-size-in-java
Note: This is a third-party link and we do not have any guarantees on this website. And Microsoft does not make any guarantees about the content.
Best Regards,
Farena
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Wednesday, July 24, 2019 5:00 PM
Hi Farena,
I'm still stuck on this issue. I've run the command to display the MaxHeapSize and it always says 700MB. I need 1024MB. I run a simple command like "java -Xmx1024m -version" and it fails to allocate the additional memory. I've uninstalled Java and re-installed and I'm still stuck at 700MB even though the machine has 4GB RAM.
I'm in a VM under VMWare running Windows 10 and OpenJDK. We have Windows 7 machines in the same environment and they all work. Just the Windows 10 machines are having issues. I would think this has to be a known problem but I can't find anything on heap size issues with Windows 10.
Thanks,
-Mike
Thursday, July 25, 2019 5:49 AM
Hi,
I can't find it as Known issues either.
Sorry for the limited information.
Please refer to this similar thread:
http://stackoverflow.com/questions/4401396/could-not-reserve-enough-space-for-object-heap
Note: This is a third-party link and we do not have any guarantees on this website. And Microsoft does not make any guarantees about the content.
For further help, please contact JVM support for more professional help.
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Thursday, July 25, 2019 7:13 AM
maybe the OpenJDK Java VM needs a continuous block of free memory?
Then there is probably a dll loaded into the virtual adress space of the 32bit process.
You could use VMMap to look at the adress layout of a 32bit java process on your system.
But as all the major java distributions are dropping support for 32bit you will have to move to the x64 runtime sooner or later, anyway. There you will not have this kind of problems.