fix(runtime): prevent memory leaks and improve shutdown/stream handling across services

This commit is contained in:
2026-02-19 08:33:41 +00:00
parent ddd0662fb8
commit 9ac297c197
8 changed files with 72 additions and 8 deletions

View File

@@ -100,6 +100,14 @@ export class VlanManager {
// Cache the result
this.normalizedMacCache.set(mac, normalized);
// Prevent unbounded cache growth
if (this.normalizedMacCache.size > 10000) {
const iterator = this.normalizedMacCache.keys();
for (let i = 0; i < 1000; i++) {
this.normalizedMacCache.delete(iterator.next().value);
}
}
return normalized;
}