Java webstart max-heap-size causes JVM cannot be started
来源:互联网 发布:工单提交系统源码php 编辑:程序博客网 时间:2024/05/21 14:10
Stack Exchange
Java webstart max-heap-size causes JVM cannot be started
We use java webstart on the client side for a java swing based aplication. Recently we have been experiencing a weird "Cannot start java Virtual machine " error when clicking in the jnlp link.
We soon find out its because the max-heap-size setting in the jnlp file was set to 1024m whereas most of the clients PC only have 1 gb physical memory. Set the max-heap-size back to 512m solved the problem. Currently, the relevant line in the jnlp file looks like
<j2se version="1.5+" initial-heap-size="100m" max-heap-size="512m"/>
I looked into the jnlp spec, but cannot find anything related to the "Java Virtual machine" issue. In theory the max-heap-size should not matter as much as the initial-heap-size. But our experience suggested quite the contrary.
The client environment:
Windows XP SP2 ( 32bit ), Internet Explorer 8.06, Memory 1G Note max-heap-size set to 1024m can cause the same problem on a machine with 2G ram.
Basically, what I am looking for here is some reference/spec/experience about why this is happening, and if there is any get-round for this issue besides increasing the physical memory size.
Another thing is that if we leave the max-heap-size unspecified, will the actual physical memory size be used as the max-heap-size, or a system-default one will be used?
Thanks, JasonW
3 Answers
It is likely that this problem is caused by the fact that a sufficiently large memory area could not be allocated to your JVM. The Java object heap has to be allocated in contiguous virtual addresses, for implementation reasons.
I noticed that on a Win XP box with 2 Gb RAM this breaks at around 1.5 GB (this off course varies depending on what processes are running on each PC, so YMMV).
Checkout the following posts for some explanations:
Java maximum memory on Windows XP
Why is the maximum size of the Java heap fixed?
I found that both the initial-heap-size and max-heap-size were not well respected by the Mac version of javaws. I ended up replacing them with something like this:
<j2se version="1.6+" java-vm-args="-Xmx1024m -Xms256m -Xss8m" />
And finally got it working on Mac with the larger heap size
Isn't there a possibility to set the Xmx for Clients with this problem permanently to a lower value? I tried to set Xmx in the Java Control Panel - without any effect. Additionally i exported the environment Varialbe jnlpx-heapsize=x,y without any effect. javaws -J-Xmx=y didn't work too. Only building manually the internal java.exe call did work.
Not the answer you're looking for? Browse other questions tagged java jvm heapjnlp java-web-start or ask your own question.
- Java webstart max-heap-size causes JVM cannot be started
- the jvm could not be started. the maximum heap size
- PhpStorm 软件出现the jvm could not be started the maximum heap size....
- SoapUI启动报错:The JVM could not be started. The maximum heap size (-Xmx) might be too large
- SoapUI启动报错:The JVM could not be started. The maximum heap size (-Xmx) might be too large
- SoapUI启动报错:The JVM could not be started. The maximum heap size (-Xmx) might be too large
- SoapUI启动报错:The JVM could not be started. The maximum heap size (-Xmx) might be too large
- Causes for java.io.FileNotFoundException: class path resource [hibernat.xml] cannot be opened becaus
- JAVA虚拟机(JVM)默认堆大小(Heap Size)定义
- java jvm heap size.....eclipse java.lang.OutOfMemoryError: Java Heap Space错误
- the msmq service cannot be started
- VMware Tools installation cannot be started
- [Hadoop]设置Task的jvm heap size
- Heap size limitition in Java
- java-jvm-heap-架构
- [SoapUI]The maximum heap size (-Xmx) might be too large
- java.lang.OutOfMemoryError: Java heap space Heap size
- how to get the jvm default heap size
- 汉英口语存在的问题及对策
- Java maximum memory on Windows XP
- 常见的Hash函数
- 编码问题一网打尽
- 设计模式之九------compositer(组合)
- Java webstart max-heap-size causes JVM cannot be started
- 在ORACLE里按用户名重建索引的方法
- GCD介绍(一): 基本概念和Dispatch Queue
- 查找程序所在上一级目录中是否存在指定文件夹,不存在就建立,并在其中新建一个txt文件
- 让TextView 自带滚动条
- 向上提升
- 文件上传遇到的问题
- 忘记了转身,忘记了遗忘 伤感心情日志
- 卡片游戏(栈)