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

Potential memory leak in gradle daemon related to build scan plugin #1730

Closed
kohlerm opened this issue Mar 31, 2017 · 3 comments
Closed

Potential memory leak in gradle daemon related to build scan plugin #1730

kohlerm opened this issue Mar 31, 2017 · 3 comments

Comments

@kohlerm
Copy link

kohlerm commented Mar 31, 2017

Expected Behavior

no memory leaks in gradle daemon

Current Behavior

See
https://discuss.gradle.org/t/memory-leak-in-build-scan-plugin/22138

I've got 45 instances of org.gradle.launcher.daemon.server.scaninfo.DefaultDaemonScanInfo$2
with each of them retaining around 300Kbyte (a JSON string):

Those instances are retained by the DefaultListenerManager

Context

I'm trying to reduce the memory footprint of the gradle daemon, because we had problems with the daemon using to much memory or running the GC too often.

Steps to Reproduce (for bugs)

Just run a couple of builds

Your Environment

Linux, latest gradle (from trunk), running build scan plugin 1.6 reporting to an internal server

@eriwen
Copy link
Contributor

eriwen commented Mar 31, 2017

@oehme @ghale would one of you please consider this? The relevant code seems to have mostly been added in June and July, but perhaps you're aware of recent changes that would be the cause?

lhotari added a commit to lhotari/gradle that referenced this issue Apr 1, 2017
- also unregister the listener that was listening for
  the buildFinished event

Fixes gradle#1730
@lhotari
Copy link
Contributor

lhotari commented Apr 1, 2017

I was looking for something easy to fix and picked this one. :) I made the PR #1736 to fix this problem.

@kohlerm
Copy link
Author

kohlerm commented Apr 3, 2017

Looks good to me. No instances leaked anymore in my tests!

@oehme oehme added this to the 4.0 RC1 milestone Apr 3, 2017
@oehme oehme self-assigned this Apr 3, 2017
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

4 participants