r/KerbalSpaceProgram • u/Inglonias • May 03 '15
PSA: Temperature gauges cause memory leaks. Disable them by pressing F10 until fixed
http://forum.kerbalspaceprogram.com/threads/118658-New-Heat-System-causes-memory-leak
193
Upvotes
30
u/TeMPOraL_PL May 03 '15
A question to those more knowledgeable about Unity and C# - how on Earth can you get so many leaks within an garbage-collected environment? Is Unity keeping references to your objects in random places? Or does something bork on the unmanaged side?
17
u/hoseja May 03 '15
Skvad pls
8
u/DerpyRedditDude1337 May 03 '15
That would explain the long freezes I seem to get. I guess it's not entirely the 2.5-hour-long flying session...
7
u/Marguy May 03 '15
I'd be more fine with this if they hadn't released this patch on a Friday. Never release software on a Friday.
6
u/gil2455526 Master Kerbalnaut May 03 '15
I warned you about release candidates bro!!!!
I told you dog!
1
u/Inglonias May 03 '15
Interestingly enough, my laptop cannot reproduce this bug. I dunno what the deal is. Maybe my intelgrated graphics are saving me somehow.
4
u/cydonian-monk May 03 '15
Does anybody know if there's a field we can set in the settings.cfg to have the Temperature gauges always turned off (or at least defaulted to off)? Memory/object leak or no I'd just prefer not use them.
20
u/Timoff May 03 '15
Jesus. Not 1 week after the official release and there is a massive error in the game. Not going to lie, pretty weak.
2
u/[deleted] May 03 '15
Alternatively, construct your PC like you make your rockets, and have 16+ GB of RAM on standby.
2
u/Flo422 May 03 '15
Thank you! I was close to giving up landing my first (since 1.0) mun science mission back on Kerbin. It kept crashing every time it got below a few km from the surface, I even tried removing all plug ins and editing the persistence file with no success. Just pressing F10 solved the issue :-)
I didn't take a look at how much memory it actually consumed before it crashed, my guess would be it hit the maximum for 32 bit applications (physically there are 16 GB in this machine).
2
u/Potz666 May 03 '15
The KerboKatz mod seems to fix this by disabling temperature gauges on scene change:
"In KSP 1.0.1 Squad introduced temperature gauges. They are awesome but cause a nasty memory leak. You can disable them by pressing F10 but it isn't persistent and has to be pressed every time you launch a new craft or go to the flight scene. This mod disables them when you go to the flight scene. If you wish to see them again you can press F10 to enable them.
No pics for this one as there is nothing to see."
http://forum.kerbalspaceprogram.com/threads/116034 Also available on CKAN
3
u/daxmeist May 03 '15
I actually coded a similar feature (indicator bars) a few years a go for a different game, and it also had a memory leak. :P
My code's problem was that it would recreate the displayed sprite every time it was updated, and even though I didn't have any references to them, the engine preserved them for some reason and didn't do a GC on them.
My solution was a lazy-loaded HashMap cache which would keep the bar values for lets say 0-100, and only recreate the sprite when it didn't exist in the cache already.
1
u/mrflib May 03 '15
Thank you for posting this. I was going mad trying to work out what mod was causing the crashing, when I tried stock and it repeated my heart sank!
I somehow corrupted my save trying to debug this too. A good lesson in back stuff up before hitting things with spanners.
1
u/GangreneTVP May 03 '15
Thanks! I had a crash last night... now I know why...
1
u/GangreneTVP May 03 '15
What happens if I turn it on to check... then turn it off again? Does it clean it up or only leak a little and stay leaked until I collect the vehicle? ... or does it start the leak and it grows until the game crashed even if it was only on for a second?
1
u/[deleted] May 03 '15
Useful to know. Thanks for that.