Closed LShirohana closed 7 years ago
Update.
After a little testing, doing /save or an auto-save causes 60 MB of memory (I assume the size of my world) to be consumed, and stays consumed. I did 3-5 more manual /save's and my memory usage jumped 300 MB.
There is definitely a memory leak / garbage collection issue going on. My VSwap is going up, non-stop.
Another little update. Starting TerrariaServer.exe from out of the directory (Which causes TShock not to load, as far as I know?) and doing save in console still causes this issue. This leads me to believe that TShock is not the issue here but Terraria itself. I am rather confused. If I am wrong and that starting TerriaServer.exe outside of the directory doesnt stop TShock from loading let me know, I assume it does because all the commands stop working when I do that.
Below are screenshots of our memory rising every /save we did.
<20:36:20> "[zook] zook": https://dl.dropboxusercontent.com/s/wdu0er1wsmmloy3/24-1495676160.png <20:36:25> "[zook] zook": https://dl.dropboxusercontent.com/s/1u6eqnjvefchp9n/24-1495676172.png <20:36:33> "[zook] zook": https://dl.dropboxusercontent.com/s/o593ctcxoby5e6t/24-1495676180.png <20:36:43> "[zook] zook": https://dl.dropboxusercontent.com/s/7h1yral5f02ywh5/24-1495676188.png <20:36:48> "[zook] zook": https://dl.dropboxusercontent.com/s/0oh90qs70wadh7t/24-1495676194.png <20:37:01> "[zook] zook": https://dl.dropboxusercontent.com/s/aqewultos8rsrkb/24-1495676206.pngYou'd have to test it with no plugins in the ServerPlugins folder to root out if it's OTAPI or TSAPI.
ServerPlugins have been renamed to backupServerPlugins to stop them from loading.
<20:51:39> "Mitch": http://i.imgur.com/IeAm4tZ.png Server loaded with 1 player inside <20:51:51> "Mitch": http://i.imgur.com/9egmP2U.png 1st save <20:52:10> "Mitch": http://i.imgur.com/Hq69JA0.png 3rd save <20:52:49> "Mitch": http://i.imgur.com/3iuuMIv.png 4th save It seems to be occuring even when ServerPlugins has been renamed to prevent loading.Confirmed on TSAPI without TShock. Saving adds ~10mb of RAM on a small world on Windows
EDIT: also occurs with TShock
Tested on vanilla on Windows (http://terraria.org/system/dedicated_servers/archives/000/000/031/original/terraria-server-1353.zip?1493153956), issue also occurs there
Have you checked by saving 5+ times? Does RAM increase every single time? RAM gain seems to correlate with the size of the world. Saving on the largest size increases my RAM by 40-50 MB
Results of further testing: On both Ubuntu and Windows, the memory is eventually freed. However it seems to take upwards of 6 saves for this to occur, and each save adds ~50mb of RAM usage on a large world. I have no idea if the free is caused by Terraria or the OS, but there's definitely a problem here. This has been forwarded to the Terraria devs
Thank you. I currently cannot run Terraria on my server using a Large World as I hit 2.5 GB usage (which is insane for a server....) before it can free itself, causing the server to kill itself.
This is weirder due to the fact my Windows terraria server doesnt push past 1 GB at all, that being said, I have yet to let it save.
Try this plugin which improves performance and memory usage https://github.com/thanatos-tshock/Tiled/releases
I don't see an issue with TShock here, is there a reason for keeping this open? cc @QuiCM
Closing as it is not related to TShock.
Previous iterations of Tshock left me at 1.1 -> 1.3 GB of ram usage concurrently, never any higher really.
With the most recent build, I am currently using 1.8 GB of ram and climbing. Server started at 74% RAM usage, and now it's at 91% and very slowly climbing upwards, megabyte by megabyte. Did something change? Did I put in an awkward setting?
Server started like so
mono --server --gc=sgen -O=all TerrariaServer.exe
Thanks, and sorry in advance if this is caused by my own ignorance!