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

Let JVM set max heap size instead of a default value of 2GB (mvnd.maxHeapSize) #560

Closed
hashhar opened this issue Jan 4, 2022 · 4 comments · Fixed by #610
Closed

Let JVM set max heap size instead of a default value of 2GB (mvnd.maxHeapSize) #560

hashhar opened this issue Jan 4, 2022 · 4 comments · Fixed by #610

Comments

@hashhar
Copy link
Contributor

hashhar commented Jan 4, 2022

Have we considered making the mvnd.maxHeapSize config default to null so that the JVM can decide the max heap size instead of the current default of 2GB?

This will bring it in line with vanilla Maven which leaves the heap size to the JVM unless an explicit -Xmx is passed (either on command line, MAVEN_OPTS or other mechanisms listed on https://maven.apache.org/configure.html).

With current out-of-box behaviour of mvnd it's a bit frustrating to discover that the daemon is crashing because it is low on memory especially since the observable failure is the lost keepalives instead of an OOM.

(See #291 (comment) for more context)

cc: @gnodet created as requested.

I'll be happy to submit a patch if we can agree on some behavior here.

@ppalaga
Copy link
Contributor

ppalaga commented Jan 4, 2022

making the mvnd.maxHeapSize config default to null so that the JVM can decide the max heap size instead of the current default of 2GB?

Sounds like a good idea. Thanks for reporting @hashhar!

@gnodet
Copy link
Contributor

gnodet commented Jan 4, 2022

Have we considered making the mvnd.maxHeapSize config default to null so that the JVM can decide the max heap size instead of the current default of 2GB?

This will bring it in line with vanilla Maven which leaves the heap size to the JVM unless an explicit -Xmx is passed (either on command line, MAVEN_OPTS or other mechanisms listed on https://maven.apache.org/configure.html).

With current out-of-box behaviour of mvnd it's a bit frustrating to discover that the daemon is crashing because it is low on memory especially since the observable failure is the lost keepalives instead of an OOM.

(See #291 (comment) for more context)

cc: @gnodet created as requested.

I'll be happy to submit a patch if we can agree on some behavior here.

@hashhar I think not setting the max heap size sounds reasonable. Do you want to provide a PR for that ?

@hashhar
Copy link
Contributor Author

hashhar commented Jan 4, 2022

Thanks for the decision. I'll work on the PR over this weekend, expect it soon.

@cheneychoi
Copy link

@hashhar hey bro,i met the same situation ,is this issue solved?

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

Successfully merging a pull request may close this issue.

4 participants