-
Notifications
You must be signed in to change notification settings - Fork 28
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
Is it possible to increase available memory? #6
Comments
Hi @mraible, thanks for reaching out. According to actions/runner#1051 (comment), memory seems more restrictive on public Windows runners for some reason. I don't think there's much we can do about that as GitHub provides the service. However, we are working on making GraalVM Native Image more memory-efficient. Anyway, I can think of three options for you:
Please feel free to share your experience and let us know if you found another way to make things work. |
@fniephaus The job I linked to is on Linux. It works fine on Mac and the job completes in 28m. Linux gets this error after 1h and 29m. With Windows, I get a different error:
|
That's a lot of time spent in GC (~81min) and explains why the build ran for so long. Nonetheless, maybe splitting the builds could help to release some memory pressure. |
Apologies for mixing that up. Let me look into this next week. |
So, I looked into the two build failures:
|
Also, GitLab recommends adjusting |
Adjusting On macOS, peak RSS is around 9GB, which is not too far away from 7GB but apparently problematic on Linux and Windows. We also have to keep in mind that the Native Image builder is invoked from Maven, which also requires some memory. I'm afraid I'm running out of ideas at the moment but will keep my eyes open. |
The GitHub action is pointing to the https://github.com/oktadev/auth0-full-stack-java-example/blob/main/.github/workflows/publish.yml#L10 That branch is using Spring Boot 2.6.3. |
I was able to fix the OOM error on Linux by specifying <plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${native-buildtools.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>test-native</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
<execution>
<id>build-native</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<imageName>native-executable</imageName>
<buildArgs>
<buildArg>--no-fallback --verbose -J-Xmx7g</buildArg>
</buildArgs>
</configuration>
</plugin> I also found that changing it from I posted my problem with "command is too long" on Windows to Stack Overflow. |
Great, thanks for the update! Now that I think about it, it makes sense: the JVM allocates only a percentage of available RAM by default, so it probably never actually used the additional swap space that we set up. That's still a lot of time spent in GCs. Maybe some additional tuning will help but glad things work for now.
Could you bump the native build tools to 0.9.10 and try again (see graalvm/native-build-tools#214)? |
I tried this here. The Windows build hasn't failed yet, but it has taken over an hour (so far). Update: it almost worked.
|
Good! I assume this ran with |
I'm currently using I was able to fix the windows build by setting the minimum pagefile size to 10GB! 🎉 You can see the successful run for details. Time spent building native images:
|
Interestingly, the successful Windows run used I'm experimenting with using the SerialGC on GitHub actions, which seems to work a bit better than the ParallelGC. However, doing that is currently a bit awkward: |
@fniephaus I accidentally removed the setting. I restored it in oktadev/auth0-full-stack-java-example@b779335. The windows build worked a couple of days ago. Now it's failing with:
This issue seems to indicate it's using more than 14GB of disk space. I'll try setting |
@fniephaus Changing the build to use |
For anyone reading this, I highly recommend upgrading to GraalVM 22.2+. We have made Native Image significantly more robust in memory-constrained environments, which means you should now be able to build large Java applications with Native Image on GitHub Actions without any problems. |
@fniephaus Hi, do I need to open a new issue? I found in oracle/graalvm-reachability-metadata#122 (comment) that the memory occupied by setup-graalvm made the Github Action device crash. |
No need @linghengqian, I've reopen this issue. How do you know that the build in question failed due to not enough memory? |
|
The build job you mention in oracle/graalvm-reachability-metadata#122 (comment) does not show any signs of memory issues, so I'm going to close this again. Maybe there's something wrong with the metadata you're contributing. |
I ask because I'm getting the following error:
You can see my actions definition here.
The text was updated successfully, but these errors were encountered: