From 6dd83181c67169b70f2aa8f0199ee6ac0e00752e Mon Sep 17 00:00:00 2001 From: Hongze Zhang Date: Fri, 23 Aug 2024 11:29:02 +0800 Subject: [PATCH] [VL] Following #6959, Fix leak memory dump is not correctly printed (#6985) --- .../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)