I am working on coding a game website, and the server has multiplayer rooms that each have intervals that send updates to the players and make the game run. My problem is after a few days of the server running, it uses a lot more CPU and memory than it should, in some cases going up to 100%. I think the intervals aren't being cleared and they are running in the background. Is there any way I can list all intervals or use another way to find out the cause of my problem?
And if its possible, can it be done in vanilla js so I can use it on other projects