fix(memory leak): implement self-destruct timeout for notyMap #119

Closed
opened 2026-04-05 16:16:09 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @SymphonyVR on 1/24/2026

This PR resolves a memory leak issue in the notification system caused by the unbounded growth of the notyMap dictionary. During long sessions this map would grow indefinitely, leading to increased memory pressure over time.
This removes the entry if no longer needed, in this case being after 60 seconds.

// The line that don't play sound after 60 seconds
const bias = new Date(Date.now() - 60000).toJSON();
if (noty.created_at < bias) {
    // don't play noty if it's over 1min old
    return;
}

Making this change not remove things that could be used later.

*Originally created by @SymphonyVR on 1/24/2026* This PR resolves a memory leak issue in the notification system caused by the unbounded growth of the notyMap dictionary. During long sessions this map would grow indefinitely, leading to increased memory pressure over time. This removes the entry if no longer needed, in this case being after 60 seconds. ```javascript // The line that don't play sound after 60 seconds const bias = new Date(Date.now() - 60000).toJSON(); if (noty.created_at < bias) { // don't play noty if it's over 1min old return; } ``` Making this change not remove things that could be used later.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/VRCX#119