This discussion is archived
5 Replies Latest reply: Apr 28, 2013 12:54 PM by rp0428 RSS

More memory allocation for java 1.6 32 bit

851442 Newbie
Currently Being Moderated
I have a small dice roller simulation program which will roll a six sided die, by use of Math.random(), the specified
BigInteger number of times, from the command line:

java -Xms1024m -Xmx2048m DiceRoller -d 6 -n 100000000

Windows 7 tells me it has 4096 m of available memory.

But java keeps telling me "invalid maximum heap size" and "maximum representable size".

But this is silly nonsense. My BigDecimal oriented program would want more memory. Besides,
surely java would not restrict the power user with any less an available memory allocation than
what the OS does avail anyway?

How do I beat this:

C:\Users\User\Desktop>java -Xms4096m -Xmx4096m DiceRoller -d 6 -n 10000000
Invalid initial heap size: -Xms4096m
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points