Memory leak in the spawning system
Description
I left the server running the whole night and the memory allocation kept growing. No clients were connected during this period, but the server was running a simulation with 30 bots. When two bots collide, the smaller bot is despawned (with the option of destroying the game object) and a new bot is spawned from the prefab. Nothing else really happening in the simulation.
Screenshots
Environment
- Server hosted on Multiplay
- NGO v2
- Unity 6
Additional Context
This is an Agar.io clone, very simple. The "food" when eaten is simply moved to a different random location. I didn't think I needed to create a pooling system for just 30 bots floating around and eating another bot every now and then, but apparently this becomes necessary.
Hi @PinoEire Could you please provide us a sample of your project for investigation? You can submit the project via:
- Google drive and share it in this thread (Faster approach)
- Unity Bug Reporter
Thank you!
@PinoEire Also, it would be helpful to know if you get the same results running the server locally and not hosted as a VM in multiplayer services. If so, running the profiler and looking at what is allocating memory could be useful.
The other thing to look at would be if you have the multiplayer tools package installed. If so, you might try removing that package and see if you get the same kind of stair-step saw tooth memory usage results.
(Just trying to narrow down where this growing allocation could be happening)
Disabling Active Scene Synchronization for whatever Network Object you're spawning resolves the memory leak.
@NAsejevs Out of curiosity, do you have the NetworkManager.LogLevel set to LogLevel.Developer?
This issue has been automatically marked as stale because it has been awaiting response for over 30 days without any activity. Please update the issue with any new information or it may be closed in 30 days.
This issue has been automatically closed because it has been stale for 30 days without any activity. Feel free to reopen if you have new information to add.