Skip to content

Commit 1545c1d

Browse files
authored
Remove XX:MaxPermSize JVM argument from gradlew, deprecated since Java 8 and removed in Java 17. (#1425)
### 📝 Description The MaxPermSize JVM argument was deprecated in JDK 8, per [this document](https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html): ``` -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. ``` Thus, since JDK 8, this argument hasn't actually done anything, but has been relatively harmless all the same. However, Java 17 actually outright removes this parameter. Running the repo's `gradlew` with Java 17 thus results in the following error: ``` % ./gradlew check Starting a Gradle Daemon, 1 busy and 1 stopped Daemons could not be reused, use --status for details FAILURE: Build failed with an exception. * What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. <...snip...> ----------------------- Unrecognized VM option 'MaxPermSize=512m' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. ``` Because this argument hasn't been doing anything (it has no effect in JDK 8 onwards), to avoid changing behavior I am proposing to remove it outright, rather than consider using `MaxMetaspaceSize` (which would be a change in behavior). With this change, I can successfully run `./gradlew check` in my environment. ### 🔗 Related Issues I didn't think it worth to create an issue for this, but happy to if helpful.
1 parent cba605c commit 1545c1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true
1111

1212
# Increase the memory to run on GH Actions
1313
# See: https://github.com/gradle/gradle/issues/8139
14-
org.gradle.jvmargs=-Xmx2g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError
14+
org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError
1515

1616
# dependencies
1717
kotlinJvmVersion = 1.8

0 commit comments

Comments
 (0)