2

i met a strange problem today about JVM initialization .

I run the same jar opening command in 2 different pcs, both pc has same java version and both are 32 bits.

java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)

One PC has following configuration

Windoex XP Service Pack 2 Amd Athelon Processor 7750 Dual Core 2 GB of DDR2 RAM

if i run the following command on XP machine

java -Xms1200m -Xmx1500m -XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=70 -jar my.jar

VM can successfully open my program with no error, though this machine has only 2GB of Physical RAM.

now the other PC's configuration is following Windows Vista Home Edition Intel P4 core 2 Duo 4 GB of DDR2 Ram and when i click on my computer properties it shows me 4 GB of RAM.

when i run above command in this machine it gives me an error message

"error occurred during initialization "

if i try to run any of the command with -Xmx > 1200 then it gives me error.

i don't understand why the later machine gives an VM Initialization error though it has double RAM then the first one ?

afuzzyllama
  • 6,538
  • 5
  • 47
  • 64
Mihir
  • 2,480
  • 7
  • 38
  • 57
  • Maybe you should decrease -Xms parameter. I suppose system doesn't have so much free memory (others programs uses it, for example). – user1516873 Mar 27 '13 at 11:46
  • 2
    There's a lot of good info in the answers to http://stackoverflow.com/questions/171205/java-maximum-memory-on-windows-xp – NPE Mar 27 '13 at 11:49
  • and http://stackoverflow.com/questions/987219/max-amount-of-memory-per-java-process-in-windows – NPE Mar 27 '13 at 11:49
  • @NPE i looked at your mentioned question. it is OK but what is the solution it is just a theory. – Mihir Mar 28 '13 at 06:14
  • @user1516873 i have all the programs closed off before i start my jar file and when i look at task manager it shows me i have 80% of free memory from 4 GB. so there should be no memory reservation problem. – Mihir Mar 28 '13 at 06:16

0 Answers0