I've got some software that requires around 1500m of memory to run correctly. I force this amount at the start using xms and xmx to make sure it has the memory it needs. I used to run it on Windows XP or Windows 7 and it ran fine. After switching to Windows 10 I suddenly find I don't have enough memory to run it anymore. After researching how memory in Java works I came across the following information on this page:
http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_heap_32bit
Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. On most modern 32-bit Windows systems the maximum heap size will range from 1.4G to 1.6G.
It sounds like I've been running on the edge of what 32bit Java is capable of. Testing the limits of my machine it seems my current max is about 1.1g. At the moment switching to 64bit may not be on the table, so I'm trying to figure out how to get back the roughly .5g I've lost from my max memory threshold. I've tried researching all of the things listed in the FAQ that could affect it.
available swap: This appears to be the page file or virtual memory. Apparently increasing this can sometimes help. Sometimes when I increase this I see a temporary improvement after a restart, but the fix never seems to last if I restart again.
kernel address space usage: This seems like it’s the memory ceiling for the operating system. Nothing we can do the change this right?
memory fragmentation: Supposedly Windows 10 is actually better at handling this than previous versions of Windows. So this shouldn’t be a factor.
VM overhead: Seems like it’s referring to RAM usage from other virtual machines. Other than Java I don’t think I have anything else running that counts as a virtual machine.
Is there any solid way to identify and correct what could be causing the difference in performance between versions of Windows? It's super frustrating because I have more physical memory now than ever, but the only RAM that matters is the RAM JVM is allowed to use, which is now somehow less.
Update
I hear you. I know I can fix it easily switching to 64 bit; my question is how I can fix it without doing that. Isn't it helpful to understand how JVM determines it's max heap for scholarly reasons as well as practical? I doubt there are many apps that hit the upper limit of 64 bit Java, but wouldn't Java behave the same way if there were?