Skip to content
Snippets Groups Projects
Commit d07ae18a authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Force a garbage collection in the event "wait forever" loop

This appears to fix the "lots of user.dat files open concurrently" behavior
that remains when a browser/client has the webv4 page open for a long
duration.

Eventually, the User objects created in this loop would be cleaned (and the
user.dat file descriptors closed), but the default garbage collection interval
(configurable) is 1000 calls to the CommonOperationCallback function. This could
be as as long as 1000 times through this loop before GC occurs.

Since this is not a performance sensitive loop (we have a call to sleep for a
full second) just force a garbage collection for each loop iteration.
parent 9772f016
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -53,6 +53,7 @@ while (client.socket.is_connected) { ...@@ -53,6 +53,7 @@ while (client.socket.is_connected) {
delete callbacks[e]; delete callbacks[e];
} }
}); });
js.gc();
mswait(1000); mswait(1000);
ping(); ping();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment