fills the RAM in server application

I wrote a server with Unity and C# language for the game server, in which many objects are made from classes
They are all code and have no game objects
Now the problem is that it fills the RAM slowly until it crashes. One or more parts of the code cause the RAM to fill up and not empty
I don’t know where it is, it should be found
I installed the memory capture and got the output in two times.

Grab the profiler and find out what is leaking.

Windows → Analysis → Profiler

If it’s in your code, fix it.

If not, file a bug.

Help → Report Bug

As the attached Memory Snapshots show, they already used the more fitting tool for the job, i.e. the Memory Profiler (at version 1.1.x no less)

That doesn’t seem to be an entirely accurate description based on the content of these snapshots, though I can understand the confusion. 9351857--1308110--upload_2023-9-21_17-44-57.png
I think you’re adding a whole bunch of instances of Pasur.Pasur4BargServer MonoBehavior instances to the CarBargContainer GameObject and never Destroy any of them. The additional components bloat up the native size for the GameObject (due to serialization data for the component, and the map to its components) and accumulate MonoBehaviour Instances with mostly Native Memory impact 9351857--1308113--upload_2023-9-21_17-47-39.png

If you wanted these to not be tied to native Memory, don’t have Pasur4BargServer inherit from MonoBehaviour.
Have one managing MB in the scene that has a list of all pure C# classes (no inheriting from UnityEngine.Object, i.e. MonoBehaviour or ScriptableObject) and call Update or whatever you need on these directly from that single MB as it iterates over the List.
Also make sure that you’re not just continuously add new instances without ever getting rid of them again. If they inherit from UnityEngine.Object, then they need to be Destoyed. If they are pure C# classes, just removing them from that list (and any (static) event or other reference) should leave them for the Managed GC to clean up.

I’d also recommend reading this and these pages from our documentation for further details.

There is also a bunch of pure C# object instances floating about but they are all held in memory by these MonoBehaviours