Skip to content

Commit

Permalink
[VL] Following #6959, Fix leak memory dump is not correctly printed (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer authored Aug 23, 2024
1 parent d12bf1f commit 50ca8a0
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,17 @@ object Runtime {
s"Runtime instance already released: $handle, ${resourceName()}, ${priority()}")
}

def dump(): KnownNameAndStats = {
new KnownNameAndStats() {
override def name: String = resourceName()
override def stats: MemoryUsageStats = collectMemoryUsage()
}
def dump(): String = {
SparkMemoryUtil.prettyPrintStats(
s"[${resourceName()}]",
new KnownNameAndStats() {
override def name: String = resourceName()
override def stats: MemoryUsageStats = collectMemoryUsage()
})
}

if (LOGGER.isDebugEnabled) {
LOGGER.debug(
SparkMemoryUtil.prettyPrintStats("About to release memory manager, usage dump:", dump()))
LOGGER.debug("About to release memory manager, " + dump())
}

RuntimeJniWrapper.releaseRuntime(handle)
Expand Down

0 comments on commit 50ca8a0

Please sign in to comment.