简体   繁体   English

如何使用Xmx命令? (JVM堆内存)

[英]How to use the Xmx command? (JVM Heap memory)

I'm new in the Oracle world and I'm working with Oracle Identity Analytics (OIA). 我是Oracle领域的新手,并且正在使用Oracle Identity Analytics(OIA)。 In the test environment everything is ok, but in production environment i'm getting an "java.lang.OutOfMemoryError", so when I checked the Xmx and Xms I saw that I had Xmx:512m and Xms:512m, that's why I'm trying to modify the Xmx value. 在测试环境中,一切正常,但是在生产环境中,我会收到“ java.lang.OutOfMemoryError”,因此,当我检查Xmx和Xms时,我看到我的Xmx:512m和Xms:512m是这就是为什么m尝试修改Xmx值。

I want to modify the Xmx and Xms values so I wrote the following line in my PuTTY: 我想修改Xmx和Xms值,所以我在PuTTY中写了以下行:

$ java -Xmx1024m $ java -Xmx1024m

But the PuTTY shows me the following: 但是PuTTY向我显示以下内容:

Usage: java [-options] class [args...] (to execute a class) or 用法:java [-options]类[args ...](执行一个类)或
java [-options] -jar jarfile [args...] (to execute a jar file) java [-options] -jar jarfile [args ...](执行jar文件)

where options include:... 其中的选项包括:...

Seems like I'm forgetting something after "Xmx1024m", but what? 好像我在“ Xmx1024m”之后忘记了一些东西,但是呢? Well, now I know I'm forgetting Jar file, Class or App name but I have no idea how to get any of those things. 好吧,现在我知道我忘记了Jar文件,类或应用程序名称,但是我不知道如何获得这些东西。 I tried putting "$AdminServer" after "Xmx1024m" but it didn't work. 我尝试将“ $ AdminServer”放在“ Xmx1024m”之后,但是没有用。

My Java version is 1.6.0_45 Oracle JRockit build R28 and the Operative Systems is Linux Server 6.5. 我的Java版本是1.6.0_45 Oracle JRockit内部版本R28,而Operative系统是Linux Server 6.5。

Regards! 问候!

You have to pass filepath to execute. 您必须传递文件路径才能执行。 Of course, you can run 当然可以跑

java -Xmx1024m

but Java doesn't know what file should be executed 但是Java不知道应该执行什么文件

You will have to pass the program-name/filename/jar-name,whatever it is,with path for which you want to set/reset the java heap size. 无论是什么程序名/文件名/罐名,都必须传递您要设置/重置Java堆大小的路径。

eg 例如

  •  java -Xms1024M -Xmx2048M -jar xi.jar 
  •  java -Xmx64m ${PROGRAM_NAME} 

Hope this helps you.Or to help you better,could you please tell us what exactly is your scenario? 希望对您有所帮助。或者,为了更好地帮助您,请您告诉我们您的情况到底是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM