Closed randomouscrap98 closed 2 years ago
The pattern seen from the Newtonsoft issue is suspicious, because it lines up with my own findings. I don't understand why the garbage collection will clean up Generation 0 and then move basically all the data to Unmanaged memory. See: https://qcs.shsbs.xyz/api/file/raw/sqcww vs https://qcs.shsbs.xyz/api/file/raw/nriwp. But I don't really know, there shouldn't be any json stuff going on during idle, so why is the heap increasing anyway?
There's also this, if any other research can be done https://stackoverflow.com/questions/64705136/gc-does-not-free-memory-but-causes-decrease-in-managed-and-increase-in-unmanage
This only happens on first load. I don't understand it, but I'll assume it has something to do with dotnet. Considering that absolutely nothing seems to be running, that's the only conclusion I can come up with. Furthermore, the memory increase does eventually stop, and then actually goes down. After several days watching the graphs, it seems like the memory usage is incredibly stable at a very low amount. I'm going to wait for two weeks to see if there's any appreciable change, but I have hope that this is fine.
Restarted the service, nobody was connected. Each websocket connection, maybe to start with, just sits there and gradually uses more and more memory. Last I checked, a new connection spawned at 8:14 with nobody on increased memory usage gradually by over 1%, and there are NO logs (meaning nothing was happening ANYWHERE) from 8:14 to 8:25, during the time the memory kept increasing. It does seem to plateau, see https://qcs.shsbs.xyz/moncon/?filename=2022-07-15&zoom=1657871072836.087
What is a websocket connection doing when idle? It sits on "ListenAsync", which is a call in the singleton class LiveEventQueue. That function creates a connection per call (so it'll go away on every message or other event)