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

update Cantaloupe JDK to 22 #374

Open
rbos opened this issue Feb 4, 2025 · 3 comments
Open

update Cantaloupe JDK to 22 #374

rbos opened this issue Feb 4, 2025 · 3 comments

Comments

@rbos
Copy link

rbos commented Feb 4, 2025

I've done a bit of a deep dive on why we were seeing Java heap OOM errors on Cantaloupe, and it seems to come down to Java's garbage collector being unable to clean up JNI-initiated memory-pinned objects. If I understand that right.

JDK22+ has region pinning which may address the issue, so there's a possible reason to upgrade.

Unfortunately, JDK21 is the current LTS, so it's probably not a great idea to use it currently.

I'm testing other fixes, like increasing GCLockerRetryAllocationCount to give the GC more chances to clear up unused memory.

edit: I haven't confirmed that this actually resolves the problem, but if the above change doesn't resolve my issue or at least paper over it, I'll work on that. This issue is probably more informational than prescriptive.

@rbos
Copy link
Author

rbos commented Feb 4, 2025

If anyone has better ways to address this issue do comment here.

@joecorall
Copy link
Contributor

Just to update this issue: we discussed this in the tech call. We will eventually want to update JDK, but will require updating our base java image which all java based images inherit from so will be a bigger lift than just updating for cantaloupe.

Rob and I spoke a bit about the underlying problem around this issue on Slack and there may be some other performance improvements to try to get around the issue in the meantime.

Rob, if you want to test your garbage collection hypothesis we could maybe build a special jdk22 version of cantaloupe and push it somewhere if you want to experiment with the new garbage collection features in jdk22?

@nigelgbanks
Copy link
Contributor

@rbos I've created an image here that uses openjdk22 for testing purposes.

docker pull islandora/cantaloupe:issue-374-jvm-issue  

You can use it in your environment without changing any of the other images for testing purposes.

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

3 participants