Bug Description
AdaptiveMemoryManager.startMonitoring() (line 71 in core/performance/AdaptiveMemoryManager.js) passes an async function to setInterval:
this.monitoringInterval = setInterval(() => {
this.checkMemoryPressure(); // returns Promise, never awaited
}, this.config.checkInterval);
checkMemoryPressure() is an async method (line 92). The arrow function calls it but doesn't await or catch the returned promise. If checkMemoryPressure() throws, the rejection is unhandled.
Impact
- Unhandled promise rejections in Node.js can crash the process (depending on
--unhandled-rejections flag)
- In browsers, silently swallowed errors make debugging impossible
- Memory management failures go undetected
Expected Fix
Either:
- Add
.catch() to the checkMemoryPressure() call in the interval
- Wrap in try/catch with error logging
- Consider making
checkMemoryPressure() synchronous with internal error handling
Files
core/performance/AdaptiveMemoryManager.js:71-73 (setInterval)
core/performance/AdaptiveMemoryManager.js:92 (async method)
Bug Description
AdaptiveMemoryManager.startMonitoring()(line 71 incore/performance/AdaptiveMemoryManager.js) passes an async function tosetInterval:checkMemoryPressure()is anasyncmethod (line 92). The arrow function calls it but doesn't await or catch the returned promise. IfcheckMemoryPressure()throws, the rejection is unhandled.Impact
--unhandled-rejectionsflag)Expected Fix
Either:
.catch()to thecheckMemoryPressure()call in the intervalcheckMemoryPressure()synchronous with internal error handlingFiles
core/performance/AdaptiveMemoryManager.js:71-73(setInterval)core/performance/AdaptiveMemoryManager.js:92(async method)