Skip to content

Commit d4035bd

Browse files
committed
improve log
1 parent 31f1feb commit d4035bd

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/memory/pool/AbstractMemoryPool.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ private long reclaimChildren(long neededBytes, MemoryPool requestingPool) {
106106
}
107107
}
108108
LOG.info("[{}] has finished to reclaim memory: totalReclaimedBytes={}, " +
109-
"neededBytes={}",
109+
"neededBytes={}, snapshot-[{}]",
110110
this,
111-
totalReclaimedBytes, neededBytes);
111+
totalReclaimedBytes, neededBytes, this.getSnapShot());
112112
return totalReclaimedBytes;
113113
}
114114

@@ -224,7 +224,7 @@ public String getName() {
224224

225225
@Override
226226
public String toString() {
227-
return getSnapShot().toString();
227+
return this.getName();
228228
}
229229

230230
@Override

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/memory/pool/impl/OperatorMemoryPool.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,18 @@ public long tryToReclaimLocalMemory(long neededBytes, MemoryPool requestingPool)
9090
LOG.info("[{}] has tried its best to reclaim memory: " +
9191
"reclaimedBytes={}," +
9292
" " +
93-
"neededBytes={}",
93+
"neededBytes={}, snapshot-[{}]",
9494
this,
95-
reclaimableBytes, neededBytes);
95+
reclaimableBytes, neededBytes, this.getSnapShot());
9696
return reclaimableBytes;
9797
}
9898
stats.setAllocatedBytes(stats.getAllocatedBytes() - neededBytes);
9999
LOG.info("[{}] has reclaim enough memory: " +
100100
"reclaimedBytes={}," +
101101
" " +
102-
"neededBytes={}",
102+
"neededBytes={}, snapshot-[{}]",
103103
this,
104-
neededBytes, neededBytes);
105-
104+
neededBytes, neededBytes, this.getSnapShot());
106105
return neededBytes;
107106
} finally {
108107
if (reclaimableBytes > 0) {
@@ -140,8 +139,8 @@ public Object requireMemory(long bytes, MemoryPool requestingPool) {
140139
} catch (OutOfMemoryException e) {
141140
// Abort this query
142141
LOG.warn("[{}] detected an OOM exception when request memory, will ABORT this " +
143-
"query and release corresponding memory...",
144-
this);
142+
"query and release corresponding memory... snapshot-[{}]",
143+
this, this.getSnapShot());
145144
findRootQueryPool().releaseSelf(String.format(e.getMessage()), true);
146145
return null;
147146
} finally {

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/memory/pool/impl/QueryMemoryPool.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ private long tryToExpandSelfCapacity(long size) {
127127
}
128128

129129
private long requestMemoryThroughArbitration(long bytes, MemoryPool requestingPool) {
130-
LOG.info("[{}] try to request memory from manager through arbitration: size={}", this,
131-
bytes);
130+
LOG.info("[{}] try to request memory from manager through arbitration: size={}, " +
131+
"snapshot-[{}]",
132+
this,
133+
bytes,
134+
this.getSnapShot());
132135
long reclaimedBytes =
133136
this.memoryManager.triggerLocalArbitration(this, bytes, requestingPool);
134137
if (reclaimedBytes > 0) {

0 commit comments

Comments
 (0)