Skip to content

Commit

Permalink
[Gradle] Do not hold a reference to Gradle objects in FUS services
Browse files Browse the repository at this point in the history
Despite the FUS services are intended to be scoped to a build, the legacy compatibility service wasn't properly managed and that caused a significant memory leak together with changes in KT-59826.
#KT-62318 In Progress

(cherry picked from commit bb23602)
  • Loading branch information
ALikhachev authored and qodana-bot committed Oct 9, 2023
1 parent 1ba9dd0 commit 74c0b1a
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,18 +282,22 @@ internal abstract class AbstractKotlinBuildStatsService(
private val logger = Logging.getLogger(AbstractKotlinBuildStatsService::class.java)
}

private val localProperties = project.localProperties

private val forcePropertiesValidation = project
.loadProperty(FORCE_VALUES_VALIDATION, localProperties)
.orNull?.toBoolean() ?: false

private val customSessionLoggerRootPath: String? = project
.loadProperty(CUSTOM_LOGGER_ROOT_PATH, localProperties)
.orNull
?.also {
logger.warn("$CUSTOM_LOGGER_ROOT_PATH property for test purpose only")
}
private val forcePropertiesValidation: Boolean

private val customSessionLoggerRootPath: String?

init {
val localProperties = project.localProperties
forcePropertiesValidation = project
.loadProperty(FORCE_VALUES_VALIDATION, localProperties)
.orNull?.toBoolean() ?: false
customSessionLoggerRootPath = project
.loadProperty(CUSTOM_LOGGER_ROOT_PATH, localProperties)
.orNull
?.also {
logger.warn("$CUSTOM_LOGGER_ROOT_PATH property for test purpose only")
}
}

private val sessionLoggerRootPath =
customSessionLoggerRootPath?.let { File(it) } ?: project.gradle.gradleUserHomeDir
Expand Down

0 comments on commit 74c0b1a

Please sign in to comment.