Figure 1 shows the memory usage and playercount over a period of 24 hours.
As you can see sometimes the memory usage suddenly increases by several hundred megabytes which is probably caused by a memory leak.
This problem exists since the beginning (v0.9.5.x).
The memory usage was tracked by an external program and represents the value that is shown in the task manager or ressource monitor (figure 2).
Using logStats as start parameter or script command System.MemoryAllocationKB() will result in significant lower values somehow.
This is what System.MemoryAllocationKB() returned when figure 2 was made:
-> MemoryAllocationKB: 1.915 MB, MemoryAllocationCount: 1.768.820
Which mods were used:
- Team ELAN - Main
- Team ELAN - Assets
- Vergys Custom Clothing (no impact if mod is deactivated)
- Beetle 1967 (no impact if mod is deactivated)
Which OS is used:
- Windows Server 2016
- Windows Server 2019
Meanwhile i am pretty sure that its not a leak in our mod itself. We are checking every player/vehicle and the gamemod including all components via GetSizeOf().
There is no increase in memory usage so i am guessing its coming out of the engine.
If this problem did not exists on official servers these are the biggest differences to the vanila mods:
- Heavy use of the rest api
- Heavy use of JsonSaveContext/JsonLoadContext
- Many player inventory operations (Deleting, adding items)
If there a logs or any data needed, let me know.