I am building an NPC application based on https://smartfoxserver.com/blog/ways-of-working-with-npcs-in-a-multiplayer-game-p-2/
But i got an issue the thread keep increasing and sudden jump in heap memory.. Total have around 10-30 NPC active all the time, I had remove all new thread/listener in the each NPC, just the default SFS listener, the NPC apps using ZGC with no fix xms/xmx with total RAM in the machine in 16GB
I notice the thread keep increased when the NPC disconnect and connected again, below is my cleanup code, do i need anything else to clear the unused thread because the SFS server it self use very little live thread 300+ compare NPC apps 4000+
I still have no clue why there is sudden jump in heap memory
Could you share some insight please
Code: Select all
sfs.removeAllEventListeners();
sfs = null;