Windows machines: Could not create the Java virtual machine

Hi

After having our application 2 weeks in production, we get on some Windows 7 machines the following error: “Could not create the Java virtual machine.” See attached file.
It only happens on Windows machines, it does not happen on Macs (so far).
It seems to appear randomly, but regularly.
After analyzing and testing, our hypothesis is it has something to do with the Java Update process called jusched.exe on Windows. We could not track down what the problem is, but it seems to be related to this process, or at least, something happens when this process is running.

Anyone seen similar problems on Windows 7 (or Windows Vista, XP)?

Regards,

looks very weird to me if that update process has anything to do with that.
That is just a scheduler process that now and then checks if there is a new version

I think for many windows users that process is running, it is also for me right now.

Maybe you can find something in this kind of dir:

C:\Users[username]\AppData\LocalLow\Sun\Java\Deployment\log

there you have various log files.

Hi Johan

We have found this behavior now on 4 quite different Windows 7 machines, 2 Laptops and 2 Desktops.

I will have a look at the suggested logs, thanks.

Regards,

What kind of jvm properties are you using on three admin page for the clients?

Do you use plugins that have native libs?

Johan

Attached are 2 set of logs of two different users (KellerGeorg and FreiRuth). In the set of KellerGeorg the logs are empty, FreiRuth’s set has an error in the log, which hopefully gives an indication of what’s going on.

Regards,

jcompagner:
looks very weird to me if that update process has anything to do with that.
That is just a scheduler process that now and then checks if there is a new version

I think for many windows users that process is running, it is also for me right now.

Maybe you can find something in this kind of dir:

C:\Users[username]\AppData\LocalLow\Sun\Java\Deployment\log

there you have various log files.

20120119_FreiRuth.zip (992 Bytes)

20120119_KellerGeorg.zip (1.85 KB)

no in those files not much can be found, except the error about the jnlp that is missing from the cache.

So it seems to go wrong even before that, i think somehow the vm arguments are wrong, for example if i do this on the command line:

java -e
Unrecognized option: -e
Could not create the Java virtual machine.

then you also can stuff like that.

Can take a look at the server that is used? So that i can see the jnlp file they are downloading from the client?

Hi Robert,

could you fix the problem now?
If yes, it would be nice to know how you got it to work.

Regards

jcompagner:
Can take a look at the server that is used? So that i can see the jnlp file they are downloading from the client?

This sentence is not clear to me, what exactly would you like to have or should I do?

Hi Thomas

No, it’s not fixed but we are trying very hard to find the cause for this, because together with the still not solved startup error of the cached Java file (see thread viewtopic.php?f=11&t=1774), the installation is very unstable and we are living from day to day but can’t roll out more machines.
Current state is that the problem is still only related to Windows machines (Windows 7).

I will of course let all know when we find the solution or cause of this.

Regards, Robert

tgs:
Hi Robert,

could you fix the problem now?
If yes, it would be nice to know how you got it to work.

Regards

Robert,

In my experience (with other Java Web Start apps, not Servoy specifically) you typically get this error when the JVM is requesting more memory than the OS can provide. What are your servoy.initialClientHeap & servoy.maxClientHeap settings? How much RAM do these machines have? Are they running the 32bit or 64bit JVM? Try reducing your initialClientHeap and maxClientHeap settings if they’re high.

Corey

Corey

Thanks for your suggestion!

Yeroc:
Robert,

In my experience (with other Java Web Start apps, not Servoy specifically) you typically get this error when the JVM is requesting more memory than the OS can provide. What are your servoy.initialClientHeap & servoy.maxClientHeap settings? How much RAM do these machines have? Are they running the 32bit or 64bit JVM? Try reducing your initialClientHeap and maxClientHeap settings if they’re high.

Corey

I use 256 and 1536 for servoy.initialClientHeap & servoy.maxClientHeap settings. What are you using? The machines have 4 GB of RAM, although Windows can only address 3 GB. We are running on Windows the 32bit JVM, because that’s the default when downloading, no idea why there is not the 64bit version offered when having a 64bit OS.

Yeroc:
Robert,

Try reducing your initialClientHeap and maxClientHeap settings if they’re high.

Corey

How much is high for you? And to what values should I reduce them?

Regards,

1536! :shock: wow, that’s high,
We have a large solution, and the max for a client set to 512MB, never had any problems.
If you really need that much memory, you have to look, WHY you need that many, maybe you can do some performance / memory tuning…

Hello Harjo

May I ask the other way round .-) Why shouldn’t I set a high memory value if there is enough memory? Memory is also cheap these days, and 512 MB is not that much any more.
But as you say I get also the impression that Windows/Java can may be these memory settings not handle that well, but I am not sure if that is really the problem. Have you any indication that more than 512 MB is a problem for Windows/Java?

Harjo:
1536! :shock: wow, that’s high,
We have a large solution, and the max for a client set to 512MB, never had any problems.
If you really need that much memory, you have to look, WHY you need that many, maybe you can do some performance / memory tuning…

Regards,

It’s a wrong assumption, that Java 32 bit can allocate 3GB or 4GB of memory.
Java 32 bit can only allocate in TOTAL about 1700MB so you are very close to that number. A client does not need so much memory (application_server is an other story)
Maybe there are more java processes running on those machines? or someone opens the client two times??

So lower it to 512MB and monitor it for a few days…

So I ask the other way around, :wink: why did you set that value so high? because the default of Servoy is MUCH lower, so someone, did change that…

Hi Harjo

The someone was I ;-) So I have to feel guilty … As we have quite some speed problems I wanted to make sure the client has enough memory, but as you say it may be a wrong decision. I try it with lower memory settings and see what happens.
Where can I read about such restrictions in Windows?

Harjo:
It’s a wrong assumption, that Java 32 bit can allocate 3GB or 4GB of memory.
Java 32 bit can only allocate in TOTAL about 1700MB so you are very close to that number. A client does not need so much memory (application_server is an other story)
Maybe there are more java processes running on those machines? or someone opens the client two times??

So lower it to 512MB and monitor it for a few days…

So I ask the other way around, :wink: why did you set that value so high? because the default of Servoy is MUCH lower, so someone, did change that…

Thanks a lot and regards,

click here: http://lmgtfy.com/?q=java+32+bit+max+memory+windows :lol:

Robert,

Robert Huber:
How much is high for you? And to what values should I reduce them?
Regards,

I can’t address typical settings for SmartClient since we don’t use it but I’ve found that on Windows once you get up to about 1500MB you can start expecting to see these types of errors. What has never made sense to me is that it’s based on the maximum heapsize setting. Theoretically at startup the JVM should only be reserving enough memory for the minimum heap size but in actuality it checks to ensure there’s enough contiguous memory to satisfy the maximum heap size. This forces you to set these values for the lowest-end machine you expect to be running your application.

If you’re experiencing performance issues that you think is due to a lack of memory you can use JVisualVM which ships with the JDK (not JRE) to visually monitor memory usage. Pay particular attention to full garbage collections. If you’re not seeing full garbage collections/memory usage is low then that’s not your performance issue.

Corey

I noticed the same problem when starting a java 7 (java 6 worked fine) 32 bit JVM on a Windows 7 64 bit OS with -Xmx1280m. The max. value it allowed was -Xmx1024m.
With java 6 or java 7 64 bits I had no such problem. I suggest that you set it to 1024m max.

Thanks, Andrei. It seems in discussing this with other developers that we are not the only one which are affect, but there are more or less workarounds to it. It would just be great to know what’s really going on here.
Do you think that not updating the path in the desktop icon by javaws? is also related to the memory settings?

Regards,

Andrei Costescu:
I noticed the same problem when starting a java 7 (java 6 worked fine) 32 bit JVM on a Windows 7 64 bit OS with -Xmx1280m. The max. value it allowed was -Xmx1024m.
With java 6 or java 7 64 bits I had no such problem. I suggest that you set it to 1024m max.

I’m not sure I understand the question(s):

Robert Huber:
Do you think that not updating the path in the desktop icon by javaws? is also related to the memory settings?

If you are asking whether or not a simple update of the smart client heap properties in admin page should result in the generated desktop link updating it’s cache, that is affirmative.
It should notice that the .jnlp file changed and get the new one with the new heap values from the server.