0

I am using a memory stick with the Readyboost property.

Java does not recognize the extra memory from the stick (if I set the Xmx to a value that exceeds the RAM value from the computer in order to use the stick memory, I get error:

Error occurred during initialization of VM
Error: Could not create the Java Virtual Machine.
Could not reserve enough space for object heap
Error: A fatal exception has occurred. Program will exit.)

Could you please give me a solution? Thank you!

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
Roxana
  • 11
  • 2

1 Answers1

2

First, Readyboost is a disk-caching feature (for persistent storage etc) - it's not related to physically addressable RAM / virtual address space.

Second, the -Xmx Java setting only sets the max heap. The JVM needs to use more than this value in total, due to the perm gen space and VM libraries / overheads. See here for further details:

Java - Setting -Xmx etc

Also, depending on what OS you're using (I'm assuming Windows 32-bit?), you can't assign more than a specified amount of memory (often 2 GiB) to a single process. Most 64-bit operating systems don't suffer from this limitation.

Community
  • 1
  • 1
Michael
  • 7,348
  • 10
  • 49
  • 86
  • 1
    There is a switch on (32b) windows servers to allow processes to use 3G of ram, but this is not supported by sun/oracle's jvm, JRocket does though (or used to when I last used it). One thing to look out for is if you use NIO, this can require a lot of memory which restricts the amount available to the jvm heap. – vickirk Sep 01 '11 at 12:57
  • @vickirk Exactly, any any native libraries etc loaded by the JVM sit on top of the Java heap too. – Michael Sep 01 '11 at 13:04