#[✓2.3.15] Performance Degradation over time (memory leak?)

1 messages · Page 1 of 1 (latest)

visual isle
#

Game version: 2.x.x
OS: Win

Steps to reproduce:

  1. Run the attached save at 25x speed for c.30 mins. All train activity is automated so the game should run fine.

This behaviour was observed in 2 player co-op, but the other player disconnected and reconnected several times as their game stability suffered greatly as they only had 16GB RAM installed.

Wrong behaviour:
As time passes, the memory footprint of Rail Route will steadily increase. After a roughly 2 hour session on this save, my game was using around 14GB. In addition, the FPS of the game gradually worsened and the contracts menu became increasingly difficult to work with over time.

Map:
Manchester

Save:
Attached

Log:
Attached

glacial anvilBOT
wind turret
#

This issue is on linux too, railroute got killed by OOM Killer after ~3h of gameplay

worthy turtle
#

You must feed the trains with your RAM to prevent delays!

#

That's the law of the train network

#

But, yeah, there's a memory leak somewhere we tried to find few times already. Maybe this time, we'll be more successful. Thanks for fully automated map :).

worthy turtle
#

Who could be telling that, we maybe don't destroy leaving trains properly? 🤔 That was never an option.

visual isle
#

The IC train spam at StaleyBridge is probably going to show up that issue very quickly

worthy turtle
#

So the issue was a little more complicated and there was not a single issue. My hypothesis with the train was not correct in the end, but the good thing, we have found and fixed memory leaks on following locations:

  • Any Light (two on train, one on path created decoration) has not cleared it's mesh (Unity bug) - we fixed by custom code to the unity
  • Train reward icons were stuck in memory because their animation has not been cleared properly
  • Every train passing over perpetual circuit caused allocation of memory that has not been cleared
  • Every autosave generated screenshot texture that has not been cleared

Will update the thread once more memory leaks will be found & fixed, but these will already improve the memory consumption over the time quite a lot

glass harbor
#

Excellent. I can generate Mac logs/repros if you think there might be differences and you don't have a mac handy.

#

Also, oof on some of those memory leaks.

worthy turtle
glass harbor
#

Ok. LMK. It seems unlikely that the leaks in question are due to the architecture, but you never know.

worthy turtle
#

Oh some of them actually were. I have found one quite big one hour before, because of the multiplayer update, A LOT of objects has not been freed as we've hold some reference to them (unwillingly). I am curious whether I've fixed them all or I will find yet another one. I mean there always be some, as it's quite hard to find & fix them all, but solving the biggest will be enough 🙂

glacial anvilBOT
worthy turtle
#
FIX: Map screenshot stuck in memory when new save has been created
FIX: Possible memory leaks in waiting train icons
FIX: Train reward icon were not destroyed properly, causing memory leaks
FIX: Controllers were stuck on memory causing memory leaks
FIX: Light2d caused memory leaks by not clearing its meshes
FIX: Memory leak in perpetual circuits
stiff granite
#

@glass harbor @visual isle @wind turret will be released in BUILD: 2.3.15

#

[✓2.3.15] Performance Degradation over time (memory leak?)