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

Default xmx changed before and after 5.0 for test executor? #8166

Closed
wisechengyi opened this issue Jan 4, 2019 · 2 comments
Closed

Default xmx changed before and after 5.0 for test executor? #8166

wisechengyi opened this issue Jan 4, 2019 · 2 comments

Comments

@wisechengyi
Copy link

When upgrading gradle from 4.10.2 to 5.1 (only variable, no other plugin changes), we observed some tests failing due to OOM in 5.1 which passed in 4.10.2 without any issue.

With further investigation, this is the command line

From 4.10.2

388229 worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 2' -Djava.awt.headless=true -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dorg.gradle.native=false -Drobolectric-deps.properties=/home/yic/t2/build/global/robolectric-deps.txt -Drobolectric.offline=true -Drobolectric.test.config=/home/yic/t2/build/projects/lib/twitter/features/onboarding/intermediates/unit_test_config_directory/debugUnitTest/generateDebugUnitTestConfig/out/com/android/tools/test_config.properties -Xverify:none -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea

From 5.1

394911 worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 1' -Djava.awt.headless=true -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dorg.gradle.native=false -Drobolectric-deps.properties=/home/yic/t2/build/global/robolectric-deps.txt -Drobolectric.offline=true -Drobolectric.test.config=/home/yic/t2/build/projects/lib/twitter/features/onboarding/intermediates/unit_test_config_directory/debugUnitTest/generateDebugUnitTestConfig/out/com/android/tools/test_config.properties -Xverify:none -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea

Hence the difference is 5.1 has -Xmx512m, and 4.10.2 does not which probably defaults to 1G.

Questions:

  1. Has it been changes lately to explicitly set the test executor's default Xmx to be 512m if maxHeapSize isn't supplied by user?
  2. If so, that means we'd probably need to manually specify it?
@GFriedrich
Copy link
Contributor

@wisechengyi: Yes this has been changed in Gradle 5 - please see https://docs.gradle.org/current/userguide/upgrading_version_4.html#rel5.0:default_memory_settings
Basically before it was "not limited" - which means it took 1/4 of your memory by Java default. Now it's limited to 512 MB and you need to set the worker heap to your needs if you need more than that.

@wisechengyi
Copy link
Author

Great, thanks for the clarification and pointer!

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

No branches or pull requests

2 participants