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

native-image --no-server -J-Xmx has no effect #1588

Closed
jroper opened this issue Aug 8, 2019 · 1 comment
Closed

native-image --no-server -J-Xmx has no effect #1588

jroper opened this issue Aug 8, 2019 · 1 comment
Assignees

Comments

@jroper
Copy link

jroper commented Aug 8, 2019

Using native-image --no-effect -J-Xmx2048m ... has no effect, in spite of the documentation saying it's supported, because the custom -Xmx is appended to the arguments after native-image's own calculated -Xmx, and the JVM is taking the first -Xmx it finds.

This was also reported in a comment on #903, but that issue was closed.

By the way, why does it default to using 80% of the machines physical memory? On my machine, I'm running browsers and slack and all sorts of other stuff, I definitely never have 80% of my physical memory free to do just one thing, so I frequently see my native-image processes being OOM killed by the OS due to this. I don't understand why that default would be chosen, it only makes sense on a dedicated build machine, and even then, build tools (like Maven) that are likely invoking the graal compiler are probably already taking up more than 20% of the available memory.

bobmcwhirter pushed a commit to bobmcwhirter/graal that referenced this issue Aug 16, 2019
Assume the user knows what they're doing if they ask for
specific values of Xmx/Xms when invoking `native-image`.

Fixes oracle#1588
@olpaw
Copy link
Member

olpaw commented Sep 3, 2019

Using native-image --no-effect -J-Xmx2048m ... has no effect

If you are using server-based building -J-Xmx2048m indeed has no effect. This is for a reason. In server mode native-image decides the mem args so that it can reuse already running servers as much as possible.

To ensure -J-Xmx2048m gets taken into account you have to combine it with --no-server.

@olpaw olpaw closed this as completed Dec 19, 2019
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.

2 participants