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

Added comment in build.gradle and developing.md for heap size #1200

Merged
merged 2 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,8 @@ Add localized strings in `src/main/resources/messages/LibertyBundles_{locale}.pr
All translatable text should be included in the message file(s). Message parameters should only contain language neutral text.

### Test Videos
To record videos for all tests, not just the failed ones, you can create a `video.properties` file in the `src/test/resources` directory and add `video.save.mode=ALL` to that file.
To record videos for all tests, not just the failed ones, you can create a `video.properties` file in the `src/test/resources` directory and add `video.save.mode=ALL` to that file.
### Handling Out of Memory Errors in Build or Tests
If you encounter an "OutOfMemoryError" during compilation or running tests, it may be due to insufficient heap space for the Java process. To resolve this:
1. Open the `build.gradle` file.
2. Increase the `memoryMaximumSize` in the `JavaCompile` task. For example: `tasks.withType(JavaCompile) { options.forkOptions.memoryMaximumSize = "4g" // Increase to 4GB or more if needed }`
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ allprojects {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.fork = true
// Increase Java heap size to avoid OutOfMemoryError during compilation or tests.
// This setting addresses issues where the JVM runs out of memory, particularly during
// large builds or tests. The '2g' value specifies a maximum heap size of 2GB
// (-Xmx2g), which should be enough to prevent memory exhaustion in most cases.
options.forkOptions.memoryMaximumSize = "2g"
}
}
Expand Down
Loading