Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unrecognized VM option 'MaxPermSize=512m' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit

I updated my IDE to Android Studio Arctic Fox version and was facing this issue when I tried to sync gradle after the upgrade was complete:

"Unrecognized VM option 'MaxPermSize=512m' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit."

enter image description here

I checked my java version, which was Java 17. I deleted my .gradle directory which didn't help. Reversed the gradle.properties changes made by the update. It didn't work either. I looked for maxPermSize value in my vm.studiooptions file. It wasn't there as suggested in some stackoverflow already asked questions.

Sharing the fix for this below.

like image 307
Pooja Singh Avatar asked Mar 18 '26 22:03

Pooja Singh


1 Answers

In JDK 17 -XX:MaxPermSize=size java option has been removed, use -XX:MaxMetaspaceSize instead.

https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#removed-java-options

like image 166
Viktória Sándor Avatar answered Mar 21 '26 13:03

Viktória Sándor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!