147

When building a Java 8 project with Maven:

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

How to remove this message?

2

8 Answers 8

175

Compatibility Guide for JDK 8 says that in Java 8 the command line flag MaxPermSize has 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_OPTS Environment User Variable:

Java 7

MAVEN_OPTS -Xmx512m -XX:MaxPermSize=128m

Java 8

MAVEN_OPTS -Xmx512m
4
  • 14
    And the reason is that the whole PermGen space has been removed in Oracle's JRE 8, AFAIK.
    – Puce
    Mar 25, 2014 at 12:32
  • 2
    If someone does not know how to do this - sudo gedit ~/.profile, add the line from the answer there and save the file.
    – gotqn
    Jul 1, 2015 at 13:16
  • I have this option set in ~/.bashrc file
    – paka
    Mar 10, 2017 at 11:25
  • @gotqn Why would you sudo edit a file in your home folder? Seems like very strange practice to me. Apr 13, 2018 at 16:16
22

The JDK 8 HotSpot JVM is now using native memory for the representation of class metadata and is called 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.

1
  • 1
    This only indirectly answers the question... The answer is "remove the flags to remove the warning". As the insightful comment by @ohad-schneider reveals, there is no one single replacement for them.
    – conny
    May 22, 2020 at 5:18
13
-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.

-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.

1
  • 18
    I think this was downvoted because it implies that you should switch previous uses of MaxPermGen with MaxMetaSpaceSize which is misleading, since their roles have practically reversed. Before Java 8 class metadata space resided in PermGen which was limited by 32/64MB, and MaxPerGen was used to increase it. Starting from Java 8 however, PermGen is no more and class metadata space is unlimited, so MaxMetaspace size is actually used to decrease it. For more information see: stackoverflow.com/a/31463972/67824 Oct 19, 2015 at 9:32
8

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

{-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.

1

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

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

I located

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

in .bashrc in my system, change it to

export MAVEN_OPTS="-Xmx512m"

issue resolved

1
  • adding this in .zshrc file resolved this issue: export MAVEN_OPTS="-Xmx512m"
    – Naga
    Feb 19, 2023 at 21:43
1

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.xml file on your project.

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

<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 :

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

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

standalone.conf

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

  1. Open the standlone.conf file which under JBoss_or_wildfly\bin folder
  2. Within this file find for #JAVA_HOME text.
  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
  • The original problem is in a maven project. It has nothing to do with JBoss.
    – Boris
    Oct 26, 2016 at 15:45
-5

For Eclipse users...

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.