@@ -214,8 +214,8 @@ func (c *hashRowContainer) GetAllMatchedRows(probeHCtx *hashContext, probeSideRo
214
214
return matched , nil
215
215
}
216
216
217
- // signalCheckpointForJoin indicates the times of row probe that a signal detection will be triggered.
218
- const signalCheckpointForJoin int = 1 << 14
217
+ // signalCheckpointForJoinMask indicates the times of row probe that a signal detection will be triggered.
218
+ const signalCheckpointForJoinMask int = 1 << 14 - 1
219
219
220
220
// rowSize is the size of Row.
221
221
const rowSize = int64 (unsafe .Sizeof (chunk.Row {}))
@@ -241,7 +241,7 @@ func (c *hashRowContainer) GetMatchedRowsAndPtrs(probeKey uint64, probeRow chunk
241
241
matchedDataSize = int64 (cap (matched ))* rowSize + int64 (cap (matchedPtrs ))* rowPtrSize
242
242
lastChunkBufPointer * chunk.Chunk = nil
243
243
memDelta int64 = 0
244
- needTrackMemUsage = cap (innerPtrs ) > signalCheckpointForJoin
244
+ needTrackMemUsage = cap (innerPtrs ) > signalCheckpointForJoinMask
245
245
)
246
246
c .chkBuf = nil
247
247
c .memTracker .Consume (- c .chkBufSizeForOneProbe )
@@ -267,7 +267,7 @@ func (c *hashRowContainer) GetMatchedRowsAndPtrs(probeKey uint64, probeRow chunk
267
267
memDelta += lastChunkSize
268
268
}
269
269
lastChunkBufPointer = c .chkBuf
270
- if needTrackMemUsage && (i & signalCheckpointForJoin == ( signalCheckpointForJoin - 1 ) ) {
270
+ if needTrackMemUsage && (i & signalCheckpointForJoinMask == signalCheckpointForJoinMask ) {
271
271
// Trigger Consume for checking the OOM Action signal
272
272
memDelta += int64 (cap (matched ))* rowSize + int64 (cap (matchedPtrs ))* rowPtrSize - matchedDataSize
273
273
matchedDataSize = int64 (cap (matched ))* rowSize + int64 (cap (matchedPtrs ))* rowPtrSize
0 commit comments