29

I get this warning when I launch IntelliJ or run play in a Play project.

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

How do I make it go away?

The answer to the same question for Maven says to remove MaxPermSize option from the MAVEN_OPTS environment variable. I don't have a MAVEN_OPTS variable set on my machine. I imagine there is some similar sbt setting, but I don't know where it is.

I see lots of explanations about what the change to Java is, but I don't see any tips for how to make this warning go away when working with Scala.

OS X 10.9.4. Scala 2.11.1. sbt 0.13.5


Edit

Basically what I'm asking is "Where are all the places on my system MaxPermSize might get set?"

I don't have a sbt-launch-lib.bash set on my machine.

I did find MaxPermSize Scala->JVM Parameters option of IntelliJ. Removing that makes the warning go away in IntelliJ.


Edit

Changed question. I originally said that this happened for SBT. (Some of the comments below address this.) This was an error on my part. It doesn't happen when I run SBT, only when I run play from the command line.

Is it a known bug for Play to specify the MaxPermSize parameter? Is there a way to make it stop?


Edit

I don't think this is a duplicate of PermGen elimination in jdk 8. That thread describes why the warning appears but does not explain how to change the IntelliJ or Play configurations to make it no longer appear.

Community
  • 1
  • 1
W.P. McNeill
  • 16,336
  • 12
  • 75
  • 111

10 Answers10

21

This warns that you are still assuming that this flag you are passing in would work but this flag has been removed from 1.8 onward, there is no perm space in jvm 1.8 onwards

so to get rid of this warning remove -XX:MaxPermSize from all the places which passes it to jvm from sbt

For example, on Windows you just need to edit the file C:\Program Files (x86)\sbt\conf\sbtconfig.txt and edit to change it to comment the XX:MaxPermSize=256M. For example:

-Xmx512M

#Commented parameter as it is deprecated on jvm 1.8 onwards
#-XX:MaxPermSize=256m

-XX:ReservedCodeCacheSize=128m

# Set the extra SBT options
-Dsbt.log.format=true
Yaron
  • 10,166
  • 9
  • 45
  • 65
jmj
  • 237,923
  • 42
  • 401
  • 438
  • 6
    you can open sbt config file C:\Program Files (x86)\sbt\conf\sbtconfig.txt and remove -XX:MaxPermSize=256m to get rid of warning – Sasha Bond Mar 02 '16 at 19:52
  • @SashaBond I wish that your remark was an actual answer so I could give you an upvote - this was exactly what I was looking for when I came to this question. – Matthew Sep 10 '16 at 04:02
  • 1
    @Matthew. Ansewer edited so other people can find the answer faster. – borjab Oct 10 '16 at 20:02
  • @Choy for IntelliJ there is another file idea.vmproperties you can edit it. I assume you are on idea. https://www.jetbrains.com/help/idea/tuning-the-ide.html – jmj Jul 12 '19 at 22:17
6

I know it's an old question, but if you're using IntelliJ, this entry:

-XX:MaxPermSize=512m

can also be found in one of these files:

PATH_TO_INTELLIJ\bin\idea.exe.vmoptions
PATH_TO_INTELLIJ\bin\idea64.exe.vmoptions

Maybe removing it there could help?

f1v3
  • 379
  • 6
  • 12
4

For anybody experiencing this on OS X/macOS, the solution for me was to go to the menu IntelliJ IDEA > Preferences..., then to Other Settings > SBT and clear the field VM parameters.

As akauppi also mentioned below, there is also another set of parameters in IntelliJ IDEA > Preferences... under Build, Execution, Deployment > Built Tools > sbt

Brideau
  • 4,564
  • 4
  • 24
  • 33
  • 1
    With IntelliJ IDEA 2017.2 it seems to be under Preferences > Build Tools > SBT > JVM Options. Thanks for the tip, showed me the way! – akauppi Nov 09 '17 at 15:38
2

Sbt reads the settings from $SBT_LAUNCHER_HOME/sbt-launch-lib.bash.

You can find following fragment, and remove -XX:MaxPermSize=${perm}m.

get_mem_opts () {
  local mem=${1:-1024}
  local perm=$(( $mem / 4 ))
  (( $perm > 256 )) || perm=256
  (( $perm < 1024 )) || perm=1024
  local codecache=$(( $perm / 2 ))

  echo "-Xms${mem}m -Xmx${mem}m -XX:MaxPermSize=${perm}m -XX:ReservedCodeCacheSize=${codecache}m"
}

PS. On windows it's in conf/sbtconfig.txt.

lpiepiora
  • 13,659
  • 1
  • 35
  • 47
2

In IntelliJ, some default run configurations include specific VM paramters.

For example, the default SBT Task run configuration VM parameters include the setting "-XX:MaxPermSize=256M"

You can simply remove this entry from the default or from your custom run config and no more warnings will appear.

durp
  • 198
  • 1
  • 6
1

You may see this warning when IntelliJ is loading the project. You can stop this warning by removing any -XX:MaxPermSize values from the SBT settings in Preferences > "VM parameters".

The actual JVM options used when running a Play2 app in IntelliJ don't seem to be exposed in the interface but you can edit your workspace.xml file manually. Look for the play2JvmOptions setting:

<setting name="play2JvmOptions" value="-Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M" />

and remove the -XX:MaxPermSize value.

Whether you think it's worth messing with your workspace.xml for the sake of a warning is up to you...

David Keen
  • 613
  • 7
  • 11
1

Actually its very easy JAVA-8 has deprecated MaxPermSize, what you need to do is simply edit your vmoptions file and replace

-XX:MaxPermSize by -XX:MaxMetaspaceSize=128m
Amit
  • 174
  • 1
  • 7
0

The -XX:MaxPermSize option is specified on the "build" file inside the play framework installation folder. Removing the MaxPermSize entry removed the warning when running play project.

eg: /play-2.2.1/framework/build

Ramadas
  • 510
  • 2
  • 7
0

Just to add to this discussion. My sbt command ended up being a script, I simply edited the script and removed the MaxPermSize reference.

I know this is about play, but searches for sbt and MaxPermSize end up here.

anoneironaut
  • 1,778
  • 16
  • 28
-1
  1. Open intellij install location->bin
  2. Edit idea.vmoptions or idea64.vmoptions file
  3. Remove -XX:MaxPermSize=xxm
  4. Save File and then restart IDEA

enter image description here

sendon1982
  • 9,982
  • 61
  • 44