I'm running into a little problem lately: I'm developing a multi-agent simulation in Java using JADE for university. Soon, an early version is supposed to be presented to some people in the economy because they are interested in the research we are doing. The program is supposed to be run on a 32-bit Windows system. It seems there is no alternative to this. Now, to make it as easy as possible to run the program on multiple systems I want to bundle it with an MySQL server (for data keeping) in a 32 bit VirtualBox VM. The VM is running Windows 7.
Now, moving the program to the VM and running it works like a charm. However, as soon as the program requires more then roughly 400mb of RAM it stops allocating new memory and start swapping, although the guest system has enough free space. This makes it hardly usable. Using -XMX and -XMS on the command line does not seem so have an effect.
On my host system (64 bit, Windows 7) it runs without problems and allocates the space it needs (about 2.5 gb). Both systems are running the latest version of Oracle Java (64 bit on host, 32 bit on guest system).
I would be very grateful for any ideas concerning this problem.
I think the problem is that the JVM needs a continous adress space which, although in theory ~3GB of memory are available, I can not get because some libraries are loaded in random locations. The only fast solution seems to be switching to a non-Windows system. Thank you Danielson.
See also the answer by Uri on Java maximum memory on Windows XP