Navigation Menu

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

Memory leak when using tasks that use Worker API and process isolation #10411

Closed
big-guy opened this issue Aug 30, 2019 · 0 comments
Closed

Memory leak when using tasks that use Worker API and process isolation #10411

big-guy opened this issue Aug 30, 2019 · 0 comments
Assignees
Milestone

Comments

@big-guy
Copy link
Member

big-guy commented Aug 30, 2019

Gradle can keep process-isolated workers across build invocations. The classpath, fork options and other details are kept about these processes.

When generating runtime classes for a Java process's fork options, Gradle generates hidden fields that contain references to the project state/service registry. Since these fork options are part of the information retained across builds, project state is also retained and never cleaned up.

This can eventually lead to OutOfMemory errors.

Expected Behavior

Gradle should not retain uncollectable project state across builds.

Current Behavior

Gradle inadvertently keeps project state across builds when a custom task uses the worker API and process isolation.

Context

This was introduced in 5.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants