Java virtual machine problem on wine

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
chamanx64
Level 2
Level 2
Posts: 10
Joined: Thu Feb 25, 2010 8:07 am

Java virtual machine problem on wine

Post by chamanx64 »

Hello again everyone!

I've got myself a problem trying to run a java application (with calls to Windows native libraries) on Wine 1.2. That aside, the problem is explained with this little example:

Code: Select all

$ wine java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)
$ wine java -xmx1024 -version
Unrecognized option: -xmx1024
Could not create the Java virtual machine.

A question : How does Wine report the free ram and virtual memory??
Any suggestions??? Thanks in advance.


java version "1.6.0_20"
Wine 1.2~rc6~0ubuntu1~karmicppa1
Linux Ubuntu 9.10 Karmic Koala
2GB ran ddr
4GB Swap space
Intel Pentium 4 2.8GHz
Ext4 Disk partition
chamanx64
Level 2
Level 2
Posts: 10
Joined: Thu Feb 25, 2010 8:07 am

Post by chamanx64 »

Sorry i post the wrong example in there, so this is the real one:

Code: Select all

$ wine java helloworld
hello world
$ wine java -Xmx500M helloworld
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Martin Gregorie

Java virtual machine problem on wine

Post by Martin Gregorie »

On Fri, 2010-07-23 at 15:45 -0500, chamanx64 wrote:
Sorry i post the wrong example in there, so this is the real one:


Code:
$ wine java helloworld
hello world
$ wine java -Xmx500M helloworld
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
What version of Java (show the output from "java -version") and is this
Java for Windows or your native OS?

What OS are you using?
How much RAM is installed?
How big is your swap space?

This is what my system shows with my Java hello world program:
- $ java -Xmx500M Hello
Hello from Java

- $ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)

- $ cat /proc/version
Linux version 2.6.32.16-141.fc12.i686.PAE
([email protected])
(gcc version 4.4.4 20100630
(Red Hat 4.4.4-10) (GCC) ) #1 SMP Wed Jul 7 04:41:17 UTC 2010

- $ cat /proc/meminfo
MemTotal: 1017560 kB
...
SwapTotal: 2048752 kB

As you can see, your command works on my laptop, a Thinkpad R61i with
1GB RAM and 2GB swap space running Fedora 12 and Sun Java SE 6.


Martin
Frédéric Delanoy

Java virtual machine problem on wine

Post by Frédéric Delanoy »

On Sat, Jul 24, 2010 at 01:22, Martin Gregorie <[email protected]> wrote:
On Fri, 2010-07-23 at 15:45 -0500, chamanx64 wrote:
Code:
$ wine java helloworld
hello world
$ wine java -Xmx500M helloworld
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
What version of Java (show the output from  "java -version") and is this
Java for Windows or your native OS?
Since he uses wine to run java, it's obviously the windows version.
What OS are you using?
How much RAM is installed?
How big is your swap space?

This is what my system shows with my Java hello world program:
- $ java -Xmx500M Hello
 Hello from Java
He tries to run wine32 java under wine, not native linux version.
However your test may help to check if he gets the same memory error.

Frédéric
Martin Gregorie

Java virtual machine problem on wine

Post by Martin Gregorie »

On Sat, 2010-07-24 at 08:49 +0200, Frédéric Delanoy wrote:
On Sat, Jul 24, 2010 at 01:22, Martin Gregorie <[email protected]> wrote:
On Fri, 2010-07-23 at 15:45 -0500, chamanx64 wrote:
Code:
$ wine java helloworld
hello world
$ wine java -Xmx500M helloworld
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
What version of Java (show the output from "java -version") and is this
Java for Windows or your native OS?
Since he uses wine to run java, it's obviously the windows version.
Some people persist in running really old Java releases (Sun SE versions
from 1.4 to 1.6 are all still common) and there *are* a number of
sources other than Sun/Oracle, you know. OpenJava and the IBM version,
for instance. Sun/Oracle supports a bare JRE, not to mention the SE, EE
and ME JDKs. On top of that there are 32 bit and 64 bit JVMs. Last but
not yet forgotten, there are still people trying to use the broken MS
Java 1.1.

It may be obvious that the OP is using Windows, but we need to know
which JDK he's using and why he thinks its necessary to run a Windows
JVM rather than a native one.
He tries to run wine32 java under wine, not native linux version.
Your supposition. The OP didn't say which JVM he was using or show us
the actual error message, just the failing command line. We don't even
know how much RAM his machine has or how much swap space he allocated.
He may simply have a small RAM with no swap space and, by requesting
500MB of heap for an apparently tiny program he may have oversubscribed
memory.


Martin
Locked