Barotrauma

Barotrauma

View Stats:
Farbott Nov 8, 2021 @ 5:43pm
Memory leaks
Not sure whats causing it, but recently my servers have been having massive memory leaks, making nearly everyone suffer at 5-10 fps, and for being the dedicated host of sessions, this is a problem.
< >
Showing 1-9 of 9 comments
big chungus Nov 8, 2021 @ 7:13pm 
NPCs and AI are known to cause memory leaks.
Regalis  [developer] Nov 9, 2021 @ 9:09am 
Thank you for bringing this up! To be clear, by memory leaks do you mean that the server's memory usage keeps increasing? I'm not entirely sure why that would affect the clients' framerate, but I suppose these could be related. Something that might give us a bit more clues on what's causing this is if you'd enter the command "showperf" in the debug console (which can be accessed by pressing F3) and shared us a screenshot of the view.

Originally posted by Frank Horrigan:
NPCs and AI are known to cause memory leaks.
I was not aware of this either, that's something we definitely need to investigate. Have you done some kind of profiling to pinpoint what's causing the memory leaks, or how do you know it's caused by the NPCs and AI? Or do you mean they cause performance issues in general, such as framerate drops?
big chungus Nov 9, 2021 @ 9:38am 
Originally posted by Regalis:
Thank you for bringing this up! To be clear, by memory leaks do you mean that the server's memory usage keeps increasing? I'm not entirely sure why that would affect the clients' framerate, but I suppose these could be related. Something that might give us a bit more clues on what's causing this is if you'd enter the command "showperf" in the debug console (which can be accessed by pressing F3) and shared us a screenshot of the view.

Originally posted by Frank Horrigan:
NPCs and AI are known to cause memory leaks.
I was not aware of this either, that's something we definitely need to investigate. Have you done some kind of profiling to pinpoint what's causing the memory leaks, or how do you know it's caused by the NPCs and AI? Or do you mean they cause performance issues in general, such as framerate drops?


I have not done much researching about this but there definitely are noticeable frame drops and lag when there are many npcs in the same area however it also depends on the host and their hardware as well as actual players in the game not spectating.
Last edited by big chungus; Nov 9, 2021 @ 9:45am
Jayslow Nov 9, 2021 @ 9:51am 
Iv noticed this, I haven't increased my crew size, and the same amount of enemy AI attack, but I have upgraded to a new vanilla ship, the kestrall, instant frame drops, coincidentally the AI has pathing issues in this particular ship so do with this info what you will, but yeah, AI pathing is definitely having an impact.
Jayslow Nov 9, 2021 @ 9:52am 
'frame drops' meaning lag spikes/temporary freezes.
Farbott Nov 9, 2021 @ 2:06pm 
Originally posted by Frank Horrigan:
Originally posted by Regalis:
Thank you for bringing this up! To be clear, by memory leaks do you mean that the server's memory usage keeps increasing? I'm not entirely sure why that would affect the clients' framerate, but I suppose these could be related. Something that might give us a bit more clues on what's causing this is if you'd enter the command "showperf" in the debug console (which can be accessed by pressing F3) and shared us a screenshot of the view.


I was not aware of this either, that's something we definitely need to investigate. Have you done some kind of profiling to pinpoint what's causing the memory leaks, or how do you know it's caused by the NPCs and AI? Or do you mean they cause performance issues in general, such as framerate drops?


I have not done much researching about this but there definitely are noticeable frame drops and lag when there are many npcs in the same area however it also depends on the host and their hardware as well as actual players in the game not spectating.
My system has been able to reliably host servers since the games steam release, it got a bit dodgy with a ♥♥♥♥ ton of crewmember bots, but not with real people, our current run has only one crewmate AI, and the game chugs for a majority of people. Im not sure what could of caused this, so sorry about being unhelpful scripts wise or something.
Velxra Nov 9, 2021 @ 2:08pm 
My guess is the AI pathing is not finding a route and it is causing infinite loops to stack. There is a problem in the update of AI walking into doors forever. Seems they dont realize the door is there or that it cannot be opened. This is referring to human AI. I have not seen any performance decrease with monsters. That is, until its on a large ship, with all the FX being used, or guns firing. Then FPS drops super low to like 5 fps. Some mods have semi patched that problem by removing shadows for various objects.


Also separate issue. We could really use a select profile option for the mod list. Such as a drop down menu and save the selected mods to that profile. Mainly because after joining several games the mod list is often reset or the previous server's mods are enabled. It is highly annoying. Just one issue out of many other mod handling problems the game has. Really wish mod support and steam file sync would be overhauled.
Last edited by Velxra; Nov 9, 2021 @ 2:10pm
Mono124 Nov 9, 2021 @ 5:22pm 
Originally posted by Farbott:
Originally posted by Frank Horrigan:


I have not done much researching about this but there definitely are noticeable frame drops and lag when there are many npcs in the same area however it also depends on the host and their hardware as well as actual players in the game not spectating.
My system has been able to reliably host servers since the games steam release, it got a bit dodgy with a ♥♥♥♥ ton of crewmember bots, but not with real people, our current run has only one crewmate AI, and the game chugs for a majority of people. Im not sure what could of caused this, so sorry about being unhelpful scripts wise or something.

While having a ton of AI/NPC has caused issues on my server, especially on some of the more dodgy subs, I have noticed on my server that after the save bloats to a certain size, I get a huge number of errors in the server console regarding writing character data and data exceeding packetsize limits. Once this starts happening, if I start the server up, wait for everyone to join, load the save and go, we can get through about 3-5 transitions before framerate starts to ♥♥♥♥ itself for everyone, people start getting kicked/disconnected fairly regularly with boolean errors, and eventually it becomes impossible to dock/transition to the next area. Once transitioning breaks, shutting the server down and rehosting means sometimes being teleported backwards a couple of areas, but the framerate issues go away and the kicking/disconnecting stops... for about 3-5 transitions. This transition limit includes going back to server lobby, so if I start a server up and have to go back to lobby for any reason, I might as well just restart the server. This only started happening once we got to the last two biomes. I am considering unpacking the save and going through the list of stations/zones and deleting data (such as the list of items available) to try to lessen save bloat, but that would be a fairly tedious process considering how the data is structured.
Last edited by Mono124; Nov 9, 2021 @ 5:23pm
Regalis  [developer] Nov 10, 2021 @ 4:02am 
Thank you for the extra info!

We are aware of certain issues in the AI and pathfinding logic in particular that are causing occasional frame drops, and are working on getting rid of those and optimizing the logic. I unfortunately can't give you an exact ETA on these, but hopefully the next hotfix will improve the situation!

These issues don't seem like memory leaks though: a memory leak is a specific kind of problem that causes a program to unnecessarily take up memory. It typically doesn't manifest as frame drops or lag, but can make the program eat up excessive amounts of memory and eventually crash if the memory runs out, which doesn't seem to be the case here.
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Nov 8, 2021 @ 5:43pm
Posts: 9