简体   繁体   English

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

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

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; Java HotSpot(TM) 64 位服务器 VM 警告:忽略选项 MaxPermSize=128m; support was removed in 8.0在 8.0 中移除了支持

How to remove this message?如何删除此消息?

Compatibility Guide for JDK 8 says that in Java 8 the command line flag MaxPermSize has been removed. JDK 8 的兼容性指南说,在 Java 8 中,命令行标志MaxPermSize已被删除。 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_OPTS Environment User Variable:因此,为了删除此消息,请编辑MAVEN_OPTS环境用户变量:

Java 7爪哇 7

MAVEN_OPTS -Xmx512m -XX:MaxPermSize=128m

Java 8爪哇 8

MAVEN_OPTS -Xmx512m

The JDK 8 HotSpot JVM is now using native memory for the representation of class metadata and is called Metaspace . JDK 8 HotSpot JVM现在使用本机内存来表示类元数据,称为Metaspace

The permanent generation has been removed.永久代已被移除。 The PermSize and MaxPermSize are ignored and a warning is issued if they are present on the command line. PermSizeMaxPermSize将被忽略,如果它们出现在命令行中,则会发出警告。

-XX:MaxPermSize=size

Sets the maximum permanent generation space size (in bytes).设置最大永久代空间大小(以字节为单位)。 This option was deprecated in JDK 8, and superseded by the -XX:MaxMetaspaceSize option.此选项在 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:MetaspaceSize option.此选项在JDK 8中已弃用,并被-XX:MetaspaceSize选项取代。

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.这将解决您的问题。

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.默认情况下 $MAVEN_PROJECTBASEDIR 是您的主目录。 So two places you can take a look, first is file $MAVEN_PROJECTBASEDIR/.mvn/jvm.config if it exists.所以有两个地方你可以看看,第一个是文件 $MAVEN_PROJECTBASEDIR/.mvn/jvm.config 如果它存在。 Secondly look at files possibly set up the environment variable MAVEN_OPTS.其次看文件可能设置了环境变量MAVEN_OPTS。 Candidate files are .bashrc, .bash_profile, .profile and those files included by them such as /etc/profile, /etc/bash.bashrc候选文件是 .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问题解决了

in case some one still get this kind of message.万一有人仍然收到这种消息。 Its happen because you add JVM argument when running maven project.这是因为您在运行 Maven 项目时添加了 JVM 参数。 Because it is related with maven you can check your pom.xml file on your project.因为它与 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 MaxPermSize argument as -Xms123m -Xmx123m , since MaxPermSize is already deprecated and wont take any effect on your JVM config :您应该将MaxPermSize参数替换为-Xms123m -Xmx123m ,因为MaxPermSize已被弃用并且不会对您的 JVM 配置产生任何影响:

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

Please to solve this problem we just have set installed JDK path in请为了解决这个问题,我们刚刚在中设置了已安装的 JDK 路径

standalone.conf独立配置文件

file which under the bin folder of JBoss\\Wildfly Server. JBoss\\Wildfly Server 的bin文件夹下的文件。 To solve this we do the following steps:为了解决这个问题,我们执行以下步骤:

  1. Open the standlone.conf file which under JBoss_or_wildfly\\bin folder打开standlone.conf文件,该文件在JBoss_or_wildfly \\ bin文件夹
  2. Within this file find for #JAVA_HOME text.在此文件中查找#JAVA_HOME文本。
  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删除#字符并将您安装的 JDK 路径设置为JAVA_HOME="C:\\Program Files\\Java\\jdk1.8.0_65"希望这能解决您的问题 谢谢

For Eclipse users...对于 Eclipse 用户...

Click Run —> Run configuration —> are —> set Alternate JRE for 1.6 or 1.7单击运行 —> 运行配置 —> 是 —> 为 1.6 或 1.7 设置备用 JRE

暂无
暂无

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

相关问题 Java HotSpot(TM) 64 位服务器 VM 警告 - Java HotSpot(TM) 64-Bit Server VM warning OpenJDK 64位服务器VM警告:忽略选项MaxPermSize = 350m; - OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; Java HotSpot(TM)64位服务器VM警告,CentOS,SmartGit,SmartSvn - Java HotSpot(TM) 64-Bit Server VM warning, CentOS, SmartGit, SmartSvn “ Java HotSpot(TM)64位服务器VM警告:无法保留共享内存。 (errno = 12)” - “Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory. (errno=12)” Java HotSpot(TM) 64 位服务器 VM 警告:失败; error='空间不足' (errno=12) - Java HotSpot(TM) 64-Bit Server VM warning: failed; error='Not enough space' (errno=12) OpenJDK 64位服务器VM和Java HotSpot(TM)64位服务器VM - OpenJDK 64-Bit Server VM AND Java HotSpot(TM) 64-Bit Server VM Java HotSpot(TM)64位服务器VM警告由于没有此类文件或目录,无法打开文件logs / gc.log - Java HotSpot(TM) 64-Bit Server VM warning Cannot open file logs/gc.log due to No such file or directory Java HotSpot(TM) 64 位服务器 VM 警告:选项 -Xverify:none 和 -noverify 在 JDK 13 中已弃用,将来可能会被删除 - Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future 在Linux Mint中打开Eclipse时出错; OpenJDK 64位服务器VM警告:忽略选项MaxPermSize = 512m; 在8.0中删除了支持 - Error opening Eclipse in Linux Mint; OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 Eclipse运行项目错误-Java hotspot(TM)64位服务器VM -1.7.0_09 &lt;&gt; 1.5.0 - Eclipse Run a project error - java hotspot(TM) 64-bit server VM -1.7.0_09 <> 1.5.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM