Skip to content

Commit ff16abc

Browse files
committed
Fixed a bug that caused a Memory Limit Exceeded error when trying to allocate more than MEMORY_LIMIT_MARGIN/2 when there was no memory limit
1 parent 9be4eda commit ff16abc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/limits/MemoryLimitListener.cc

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ MemoryLimitListener::MemoryLimitListener(uint64_t memoryLimitKb)
6565
Arg(2)>MEMORY_LIMIT_MARGIN/2));
6666
}
6767
tracer::TraceAction MemoryLimitListener::handleMemoryAllocation(uint64_t allocatedMemoryKb){
68+
if(memoryLimitKb_==0) return tracer::TraceAction::CONTINUE; // If there is no limit, we allow for allocation
6869
uint64_t memoryUsage = getMemoryUsageKb() + allocatedMemoryKb;
6970
memoryPeakKb_ = std::max(memoryPeakKb_, memoryUsage);
7071
outputBuilder_->setMemoryPeak(memoryPeakKb_);

0 commit comments

Comments
 (0)