How do I make the "Java Hot Spot MaxPermSize" warning go away when using IntelliJ or Play?

2022-09-01 13:14:19

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

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 option from the environment variable. I don't have a variable set on my machine. I imagine there is some similar sbt setting, but I don't know where it is.MaxPermSizeMAVEN_OPTSMAVEN_OPTS

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 might get set?"MaxPermSize

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

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


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 from the command line.play

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


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.


答案 1

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 from all the places which passes it to jvm from sbt-XX:MaxPermSize

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

-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

答案 2

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?


推荐