From ae2e669c630367835a79d226c2eafe743d37eb84 Mon Sep 17 00:00:00 2001 From: Hongze Zhang Date: Fri, 23 Aug 2024 09:20:07 +0800 Subject: [PATCH] [VL] Following #6959, leak memory dump is not correctly printed --- .../scala/org/apache/gluten/runtime/Runtime.scala | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gluten-data/src/main/scala/org/apache/gluten/runtime/Runtime.scala b/gluten-data/src/main/scala/org/apache/gluten/runtime/Runtime.scala index 7ba72b379ba3..63db3e58e51f 100644 --- a/gluten-data/src/main/scala/org/apache/gluten/runtime/Runtime.scala +++ b/gluten-data/src/main/scala/org/apache/gluten/runtime/Runtime.scala @@ -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)