You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ performance }=require('perf_hooks')constMarksPerChunk=1000*1000// ONE MILLION MARKSletmarks=0setInterval(printMarks,1000)setImmediate(add_marks_endlessly)// make it async-y, to give printMarks a chance to runfunctionadd_marks_endlessly(){for(leti=0;i<MarksPerChunk;i++){performance.mark('another')marks++}setImmediate(add_marks_endlessly)}functionprintMarks(){console.log(`${newDate().toISOString()}${marks/MarksPerChunk}M marks`)}
$ ~/.nvm/versions/node/v16.7.0/bin/node --max_old_space_size=1024 perf-mark.js(node:59477) MaxPerformanceEntryBufferExceededWarning: Possible perf_hooks memory leak detected. 1000001 mark entries added to the global performance entry buffer. Use performance.clearMarks to clear the buffer.(Use `node --trace-warnings ...` to show where the warning was created)2021-11-08T13:46:20.422Z 3M marks2021-11-08T13:46:21.718Z 6M marks2021-11-08T13:46:23.245Z 9M marks2021-11-08T13:46:24.748Z 11M marks2021-11-08T13:46:28.010Z 12M marks<--- Last few GCs --->[59477:0x7fc998008000] 10512 ms: Scavenge 1020.4 (1042.1) -> 1019.9 (1044.3) MB, 1.6 / 0.0 ms (average mu = 0.175, current mu = 0.150) allocation failure <--- JS stacktrace --->FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Sorry for the incorrect categorization. I was thinking that the change didn't break the functionality of existing codes, but didn't categorize that introducing memory leaks on the non-spec-compliant behavior as breaking change. I agree that we should highlight on the document that for spec-compliance it is mandatory to call performance.clearMarks() to clear the performance timeline.
Version
16.7.0
Platform
No response
Subsystem
perf_hooks
What steps will reproduce the bug?
From @pmuellr elastic/kibana#116636 (comment)
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
What do you see instead?
The change was incorrectly classified as not introducing any breaking changes
#39297 (comment)
Additional information
Could we highlight this behaviour change in the documentation?
The text was updated successfully, but these errors were encountered: