kazuyukitanimura commented on code in PR #1702: URL: https://github.com/apache/datafusion-comet/pull/1702#discussion_r2070493011
########## spark/src/main/scala/org/apache/comet/CometExecIterator.scala: ########## @@ -130,6 +134,21 @@ class CometExecIterator( def getNextBatch(): Option[ColumnarBatch] = { assert(partitionIndex >= 0 && partitionIndex < numParts) + if (memoryProfilingEnabled) { + val memoryMXBean = ManagementFactory.getMemoryMXBean + val heap = memoryMXBean.getHeapMemoryUsage + val nonHeap = memoryMXBean.getNonHeapMemoryUsage + + def mb(n: Long) = n / 1024 / 1024 + + // scalastyle:off println + println( + "JVM_MEMORY: { " + + s"heapUsed: ${mb(heap.getUsed)}, heapCommitted: ${mb(heap.getCommitted)}, " + + s"nonHeapUsed: ${mb(nonHeap.getUsed)}, nonHeapCommitted: ${mb(nonHeap.getCommitted)} " + + "}") Review Comment: Perhaps `logInfo` ? If println is preferred, we may have to add back `// scalastyle:on println` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org