-
Notifications
You must be signed in to change notification settings - Fork 212
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
Too many JVM options resulting in no-reuse of daemons #1119
Comments
The root cause is that options are capped at 1024 bytes in |
We can raise the limit, but we need to raise the global registry size limit too:
The registry should be kept small and not used to store random strings, as it's kept in memory. That's why the only "long" string was cut I think (it's usually the stop reason). I wonder if storing a digest of the JVM properties would be sufficient... |
That would solve the problem, but I am not sure the perf penalty on every mvnd invocation is worth of it? After all, 99% of builds have none or just a few props. I'd say the memory penalty should be rather paid by folks having many props. @olsavmic I wonder, what would be the limit in bytes that would solve this for you? |
Looking at the implementation, it actually seems that the constant is not named correctly. The code already supports resizing of the buffer based on the needs (both up and down). The MAX_LENGTH is just a default AND min value.
From the practical standpoint, I doubt we will ever go over 2x the current limit. We're just slightly over the limit in one of our projects due the Given the auto-resizing buffer logic, I'd argue that switching to |
Sounds good to me. Would you like to send a PR with a test? |
Given the following artificially constructed
.mvn/jvm.config
, the daemons are NEVER reused.Removing a single line in this config immediately results in correct daemon reuse.
We have discovered that it does not matter what JVM options are used, it's only related to the total length of options.
(Running on MacOS, Apple Silicon, JDK 22 Temurin, mvnd 1.0.2)
The text was updated successfully, but these errors were encountered: