-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Reducing high memory consumption #348
Comments
Hi @eugene-krivobokov thanks for bringing this up. I'm very open to ideas on how to improve this. I'm wondering, is the memory still retained after a single build completes? At least in the way it is built, it is intentional that these objects are retained during a single build, but not from one build to the next. |
Hi! The memory is released after the build completes. The issue is with high memory consumption while the build is running. It's a limiting factor on laptops, where we can't increase memory easily. In general, I know two approaches.
|
Found a workaround to disable
// Disable task monitoring by default providing an option to opt-in.
// See 'doctor.enableTaskMonitoring' in gradle.properties for details.
val enableTasksMonitoring = properties.getOrDefault("doctor.enableTaskMonitoring", "false").toString().toBoolean()
if (!enableTasksMonitoring) {
logger.info("Gradle Doctor task monitoring is disabled.")
gradle.sharedServices.unregister("listener-service")
}
fun BuildServiceRegistry.unregister(name: String) {
val registration = registrations.getByName(name)
registrations.remove(registration)
(registration.service as RegisteredBuildServiceProvider<*, *>).maybeStop()
}
# Gradle Doctor might increase memory consumption when task monitoring is enabled, so it is disabled by default.
# Some features can't work without task monitoring:
# doctor-negative-savings, doctor-slow-build-cache-connection, doctor-slow-maven-connection
# Issue: https://github.com/runningcode/gradle-doctor/issues/348
doctor.enableTaskMonitoring=false |
Hi!
There was a report about a potential memory leak: #247
It turned out that this is expected and the plugin stores a quite detailed information about build operations to make needed calculation.
The thing is that memory consumption increases so big that it makes using of the plugin problematic on big projects.
In my environment this is the top-1 memory consumer.
Therefore, I'd like to revive this topic to clarify potential improvements, if possible.
With plugin:
Without plugin:
The text was updated successfully, but these errors were encountered: