Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WHY?] JBR JDK 21 is sooooo slow compared to super fast JBR JDK 17 #422

Open
copyandexecute opened this issue Jul 24, 2024 · 5 comments
Open

Comments

@copyandexecute
Copy link

Hi, I'm coding minecraft mods with fabric and I loved jbr 17 class hotswapping it was so fast and I've never head any problem, but since minecraft 1.21 requires java 21 I had to switch... After hotswapping like 5 times I get this error:

grafik

After Adding these argument, it got a little bit better but not that good as with 17

-XX:NonNMethodCodeHeapSize=256M
-XX:ProfiledCodeHeapSize=256M
-XX:NonProfiledCodeHeapSize=256M
-XX:ReservedCodeCacheSize=768M

Whats the reason for this and how can I fix it?

@skybber
Copy link
Collaborator

skybber commented Jul 24, 2024

It was already reported by @Kademlia

https://youtrack.jetbrains.com/issue/JBR-7351/JVM-CodeCache-will-not-be-cleaned-using-G1GC-if-Hotswap-Agent-is-enabled-since-JBR-6419-jbr21.351

The fix is in the jbr21 branch and will be, hopefully, included in the next jbr21 release. Regarding the slowness of JBR21, this could occur because class loaders are checked for new classes iteratively now. This process might be more noticeable in applications with a lot of classes (tens/hundreds of thousands of classes).

@NikitkoCent
Copy link
Member

@copyandexecute, just in case, which exactly build and which exactly link did you use to get the JBR 21 build?

@copyandexecute
Copy link
Author

@skybber Thanks a lot for the fast reply, good to know <3 this issue can be closed

@copyandexecute
Copy link
Author

@Kademlia
Copy link

@copyandexecute
You can test the last release without the change:
https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.2b346.3

Increasing the CacheSizes will make hotswapping slower in general. Using the default should be faster than providing the increased values. Going lower might even improve the speed while debugging (for example -XX:-SegmentedCodeCache -XX:ReservedCodeCacheSize=96m) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants