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

java.lang.VirtualMachineError: Out of space in CodeCache for method handle intrinsic #582

Open
Artur- opened this issue Sep 4, 2024 · 3 comments

Comments

@Artur-
Copy link
Contributor

Artur- commented Sep 4, 2024

Reporting this on behalf of other people as I have not experienced it myself nor do I know if it is expected or some kind of problem.

Anyway, it seems like even after a few hotswaps (around 5) you might run into this java.lang.VirtualMachineError: Out of space in CodeCache for method handle intrinsic or

OpenJDK 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
OpenJDK 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
OpenJDK 64-Bit Server VM warning: Initialization of C1 CompilerThread1 thread failed (no space to run compilers)

Is this something common that others run into? I found some old JDK bugs that were resolved related to this

@skybber
Copy link
Contributor

skybber commented Sep 4, 2024

Artur- added a commit to vaadin/intellij-plugin that referenced this issue Sep 4, 2024
MarcinVaadin added a commit to vaadin/intellij-plugin that referenced this issue Sep 4, 2024
* feat: Debug using Hotswap Agent

* Fallback to bundled JBR if Java version is compatible

Bundle and copy hotswap agent

* Add --add-opens which may or may not be needed

* Detect project Java target version

* Use HotswapAgent from ~/.vaadin/intellij

* Extract helpers

* fix typo

* Show error if no suitable JBR is found

* icon

* Fix Out of space in CodeCache for method handle intrinsic

See HotswapProjects/HotswapAgent#582

* Use hotswap agent 2.0.0

* Properly add opens arguments

* const

* More opens

* use VaadinIcons

* use proper classloader

---------

Co-authored-by: marcin <marcin@vaadin.com>
@emarc
Copy link

emarc commented Oct 21, 2024

I get this even with -XX:+ClassUnloading.

With the default, I run out of CodeCache pretty quickly, but even after doing -XX:ReservedCodeCacheSize=128M I run out after a while.

Default:

[197.229s][warning][codecache] CodeCache is full. Compiler has been disabled.
[197.229s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=49152Kb used=49151Kb max_used=49151Kb free=0Kb
 bounds [0x000000010a9a0000, 0x000000010d9a0000, 0x000000010d9a0000]
 total_blobs=27751 nmethods=26995 adapters=682
 compilation: disabled (not enough contiguous free space left)
              stopped_count=1, restarted_count=0
 full_count=1

After increasing:

[250.099s][warning][codecache] CodeCache is full. Compiler has been disabled.
[250.099s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=131072Kb used=131071Kb max_used=131071Kb free=0Kb
 bounds [0x0000000107274000, 0x000000010f274000, 0x000000010f274000]
 total_blobs=75893 nmethods=75138 adapters=682
 compilation: disabled (not enough contiguous free space left)
              stopped_count=1, restarted_count=0
 full_count=1

@skybber
Copy link
Contributor

skybber commented Oct 21, 2024

Problem should be is fixed in last JBR 21 version and it works without any additional options.

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