Invalid initial heap size: -Xms512m -Xmx1024m Could not create Java Virtual Machine

很遺憾,我無法reproduce當時的錯誤,只好簡單描述一下了,sigh....

在批處理文件裡設置jvm的初始內存最大/最小值。

1)首先,判斷系統可以設置的最大內存值

Start > Run > input 'cmd' in [Run] dialog and click on 'OK'.

In command window, input the following command

java -Xmx2046m -version


set JAVA_OPTS=-server -Xms768m -Xmx768m -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=256m

<mxmlc file="${flex.src}/@{name}.mxml" output="${flex.bin}/@{name}.swf" actionscript-file-encoding="UTF-8" keep-generated-actionscript="false" incremental="false" optimize="true" fork="true" classpathref="flex.lib.classpath">
<jvmarg line="-Xms512m -Xmx700m -XX:MaxPermSize=700m -XX:PermSize=512m" />
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<source-path path-element="${FLEX_HOME}/frameworks" />

注意這裡提示說明2046m超出了系統的限制。將最大內存值減小至1640m時,查看執行結果,說明系統的最大限制為1640M.

<wbr></wbr>

2)在批處理文件裡設置JAVA_OPTS=-Xms516m -Xmx1024m後,執行時提示如下錯誤:

Invalid initial heap size: -Xms512m -Xmx1024m

Could not create Java Virtual Machine

根據bug_34029<wbr>嘗試<strong><span style="color:#546D8E; word-wrap:normal; word-break:normal; line-height:21px">將最大與最小內存值分別設置在兩個變量裡</span></strong>,即,</wbr>

set JAVA_OPTS_MAX=-Xmx1024m

set JAVA_OPTS_MIN=-Xms512m

便成功了。(在reproduce時,發現即使定義在同一變量裡似乎也是沒有問題的,原因未查)


Bug34029- Invalid initial heap size: -Xms64m -Xmx512m Could not create Java Virtual Machine
Status:RESOLVED INVALID
Product: Ant
Component: Build Process
Version:1.5
Platform: Other other
Importance:P2 normal(vote)
TargetMilestone:---
Assigned To:Ant Notifications List
URL:
Keywords:
Dependson:
Blocks:
Show dependencytree
Reported:2005-03-16 08:08 UTC byRajadurai
Modified:2008-02-22 12:18 UTC (History)
CC List: 0 users



Attachments

NoteYou need tolog inbefore you can comment on or make changes to this bug.
Description Rajadurai 2005-03-16 08:08:48 UTC
i m using jdk1.5.0_01 if i user java.exe of jdk1.5.0_01 then i m getting the 
following error  Invalid initial heap size: -Xms64m -Xmx512m Could not create 
Java Virtual Machine. But if i run java.exe in the command prompt with the same 
jvm arguments. its not giving any problem. is this the bug in ant or i m doing 
any mistake. Following the target 

	<target name="generateActionsXml" depends="init">
		<echo>+---------------------------------------------------
+</echo>
		<echo>|                                                   
|</echo>
		<echo>| G E N E R A T E   C U D S F   X M L               
|</echo>
		<echo>|                                                   
|</echo>
		<echo>+---------------------------------------------------
+</echo>
		<echo>Generating actions xml for ${ant.project.name}</echo>
		<mkdir dir="${cdms.actionsxml.dir}"/>
		<java classname="com.trigent.core.codegen.CreateCUDSFXml" 
fork="true" jvm="${jdk1.5.home}/bin/java.exe" dir="${cdms.home}">
			<jvmarg value="-Xms64m -Xmx512m"/>
			<sysproperty key="log4j.configuration" value="cdms-
log4j.xml"/>
			<arg value="${cdms.actionsxml.dir}"/>
			<arg value="${cdms.actionsxmlschema.prefix}"/>
			<arg value="${cdms.datamodel.xml}"/>
			<classpath>
				<path location="${cdms.src.dir}"/>
				<path location="${cdms.config.dir}"/>
				<path refid="cdms.class.path"/>
			</classpath>
		</java>
		<echo>Generated actions xml for ${ant.project.name}</echo>
	</target>
Comment 1 Jan Mat 2005-03-16 08:12:15 UTC
<jvmarg value=""/> gets only ONE value - maybe with spaces.

Use two <jvmarg value=""/> or a <jvmarg line=""/>.

As the manual sais ...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值