Java HotSpot(TM) 64 位服务器 VM 警告:忽略选项 MaxPermSize

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22634644/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 16:58:11  来源:igfitidea点击:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize

javamaven

提问by Boris

When building a Java 8 project with Maven:

使用 Maven 构建 Java 8 项目时:

mvn clean package

I get this message:

我收到这条消息:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0

Java HotSpot(TM) 64 位服务器 VM 警告:忽略选项 MaxPermSize=128m;在 8.0 中移除了支持

How to remove this message?

如何删除此消息?

采纳答案by Boris

Compatibility Guide for JDK 8says that in Java 8 the command line flag MaxPermSizehas been removed. The reason is that the permanent generation was removed from the hotspot heap and was moved to native memory. So in order to remove this message edit MAVEN_OPTSEnvironment User Variable:

JDK 8 的兼容性指南说,在 Java 8 中,命令行标志MaxPermSize已被删除。原因是永久代从热点堆中移除并移至本机内存。因此,为了删除此消息,请编辑MAVEN_OPTS环境用户变量:

Java 7

爪哇 7

MAVEN_OPTS -Xmx512m -XX:MaxPermSize=128m

Java 8

爪哇 8

MAVEN_OPTS -Xmx512m

回答by Martin Seeler

The JDK 8 HotSpot JVMis now using native memory for the representation of class metadata and is called Metaspace.

JDK 8的HotSpot JVM现在使用本地存储器,用于类的元数据的表示,被称为元空间

The permanent generation has been removed. The PermSizeand MaxPermSizeare ignored and a warning is issued if they are present on the command line.

永久代已被移除。该PermSizeMaxPermSize被忽略,如果它们存在的命令行上发出警告。

回答by Amit

In JBoss EAP 6.4, right click on the server and open launch configuration under VM argument you will find

在 JBoss EAP 6.4 中,右键单击服务器并在 VM 参数下打开启动配置,您会发现

{-Dprogram.name=JBossTools: jboss-eap" -server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m}

update it to

将其更新为

{-Dprogram.name=JBossTools: JBoss 6.4" -server -Xms512m -Xmx512m}

this will solve your problem.

这将解决您的问题。

回答by mama...

-XX:MaxPermSize=size

Sets the maximum permanent generation space size (in bytes). This option was deprecated in JDK 8, and superseded by the -XX:MaxMetaspaceSizeoption.

设置最大永久代空间大小(以字节为单位)。此选项在 JDK 8 中已弃用,并被该-XX:MaxMetaspaceSize选项取代。

-XX:PermSize=size

Sets the space (in bytes) allocated to the permanent generation that triggers a garbage collection if it is exceeded. This option was deprecated in JDK 8, and superseded by the -XX:MetaspaceSizeoption.

设置分配给永久代的空间(以字节为单位),如果超出则触发垃圾回收。此选项在JDK 8中已弃用,并被该-XX:MetaspaceSize选项取代。

回答by Jonathan L

I got similar message when running command line mvn (version 3.3.3) on Linux with Java 8. By opening maven script /$MAVEN-HOME/bin/mvn, found the following line

在使用 Java 8 的 Linux 上运行命令行 mvn(版本 3.3.3)时,我收到了类似的消息。通过打开 maven 脚本 /$MAVEN-HOME/bin/mvn,找到以下行

MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"

Where $MAVEN_PROJECTBASEDIR by default is your home directory. So two places you can take a look, first is file $MAVEN_PROJECTBASEDIR/.mvn/jvm.config if it exists. Secondly look at files possibly set up the environment variable MAVEN_OPTS. Candidate files are .bashrc, .bash_profile, .profile and those files included by them such as /etc/profile, /etc/bash.bashrc

默认情况下 $MAVEN_PROJECTBASEDIR 是您的主目录。所以有两个地方你可以看看,第一个是文件 $MAVEN_PROJECTBASEDIR/.mvn/jvm.config 如果它存在。其次看文件可能设置了环境变量MAVEN_OPTS。候选文件是 .bashrc、.bash_profile、.profile 以及它们包含的那些文件,例如 /etc/profile、/etc/bash.bashrc

I located

我定位

export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"

in .bashrc in my system, change it to

在我系统的 .bashrc 中,将其更改为

export MAVEN_OPTS="-Xmx512m"

issue resolved

问题解决了

回答by Salahin Rocky

Please to solve this problem we just have set installed JDK path in

请为了解决这个问题,我们刚刚在中设置了安装的 JDK 路径

standalone.conf

独立配置文件

file which under the binfolder of JBoss\Wildfly Server. To solve this we do the following steps:

JBoss\Wildfly Server的bin文件夹下的文件。为了解决这个问题,我们执行以下步骤:

  1. Open the standlone.conffile which under JBoss_or_wildfly\bin folder
  2. Within this file find for #JAVA_HOMEtext.
  3. Remove the #character and set your installed JDK path as JAVA_HOME="C:\Program Files\Java\jdk1.8.0_65"Hope this will solve your problem Thanks
  1. 打开standlone.conf文件,该文件在JBoss_or_wildfly \ bin文件夹
  2. 在此文件中查找#JAVA_HOME文本。
  3. 删除#字符并将您安装的 JDK 路径设置为 JAVA_HOME="C:\Program Files\Java\jdk1.8.0_65"希望这能解决您的问题 谢谢

回答by Raja Rajamani

For Eclipse users...

对于 Eclipse 用户...

Click Run —> Run configuration —> are —> set Alternate JRE for 1.6 or 1.7

单击运行 —> 运行配置 —> 是 —> 为 1.6 或 1.7 设置备用 JRE

回答by satrioaditya

in case some one still get this kind of message. Its happen because you add JVM argument when running maven project. Because it is related with maven you can check your pom.xmlfile on your project.

万一有人仍然收到这种消息。这是因为您在运行 Maven 项目时添加了 JVM 参数。因为它与 maven 相关,所以您可以检查pom.xml您项目中的文件。

find this line <argLine>...</argLine>, on my project I also have argument below

找到这一行<argLine>...</argLine>,在我的项目中,我也有下面的论点

<argLine>-Xmx1024m -XX:MaxPermSize=512m -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>

you should replace MaxPermSizeargument as -Xms123m -Xmx123m, since MaxPermSizeis already deprecated and wont take any effect on your JVM config :

您应该将MaxPermSize参数替换为 as -Xms123m -Xmx123m,因为MaxPermSize它已被弃用并且不会对您的 JVM 配置产生任何影响:

<argLine>-Xms512m -Xmx512m  -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>