Skip to content

Commit

Permalink
[VL] Defer debug log generation (#5672)
Browse files Browse the repository at this point in the history
Memory dump message will be generated whether debug log enable or not, add check to defer it and save cpu cycles.
  • Loading branch information
Yohahaha authored May 9, 2024
1 parent 5da9f6e commit 9496509
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,22 @@ private static native long create(

@Override
public void release() throws Exception {
LOGGER.debug(
SparkMemoryUtil.prettyPrintStats(
"About to release memory manager, usage dump:",
new KnownNameAndStats() {
@Override
public String name() {
return name;
}

@Override
public MemoryUsageStats stats() {
return collectMemoryUsage();
}
}));
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(
SparkMemoryUtil.prettyPrintStats(
"About to release memory manager, usage dump:",
new KnownNameAndStats() {
@Override
public String name() {
return name;
}

@Override
public MemoryUsageStats stats() {
return collectMemoryUsage();
}
}));
}
release(nativeInstanceHandle);
if (listener.getUsedBytes() != 0) {
LOGGER.warn(
Expand Down

0 comments on commit 9496509

Please sign in to comment.