Skip to content

Commit

Permalink
use debugLambda to prevent unnecessary string parsing during GC if de…
Browse files Browse the repository at this point in the history
…bug is not enabled

Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Nov 12, 2022
1 parent 7e2d372 commit e531187
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.hyperledger.besu.plugin.services.storage.rocksdb.segmented;

import static org.hyperledger.besu.util.Slf4jLambdaHelper.debugLambda;

import org.hyperledger.besu.plugin.services.exception.StorageException;
import org.hyperledger.besu.plugin.services.metrics.OperationTimer;
import org.hyperledger.besu.plugin.services.storage.KeyValueStorageTransaction;
Expand Down Expand Up @@ -178,9 +180,10 @@ public void close() {
@Override
protected void finalize() {
if (!isClosed.get()) {
LOG.debug(
debugLambda(
LOG,
"RocksDBSnapshotTransaction was not closed. This is a memory leak. Stack trace: {}",
Arrays.toString(stackTrace));
() -> Arrays.toString(stackTrace));
close();
}
}
Expand Down

0 comments on commit e531187

Please sign in to comment.