Jump to content

Running KSP on Linux to fix RAM issues - is it worth it?


Recommended Posts

I've been having a lot of issues playing KSP lately because of what I believe are RAM overflow garbage collection issues. They cause occasional crashes and make loading times incredibly long. (For example, it takes KSP a good 1.5 minutes of loading to go from the VAB to the launchpad.) I've tried reducing my mods, installing MemGraph, and increasing the RAM buffer, but the long loading times still persist.

I've heard that running KSP on Linux reduces RAM issues. However, I have absolutely no experience with Linux, and I'm currently running Windows 10. Is it worth the effort? If switching fixes most (or all) RAM issues that'd be amazing.

EDIT: I'm running KSP v1.5.1 on an SSD with around 34 mods installed. My computer has 32GB of RAM and an i5-8600k.

Edited by The_8_Bit_Zombie
Link to comment
Share on other sites

First question is, how much RAM do you have?
2nd, why do you suspect RAM at this point?

You can check the top of your KSP error.log, and it should show RAM usage at the time of crash.
/AppData/LocalLow/Squad/Kerbal Space Program/Crashes

Link to comment
Share on other sites

I wouldn't say the game running on Linux magically fixes any memory problems.

We definitely need more information.  If you're paging a lot to an older, slower, and/or dying mechanical HDD, there could be your issue.  Linux won't help that.

 

Link to comment
Share on other sites

6 hours ago, Stone Blue said:

First question is, how much RAM do you have?
2nd, why do you suspect RAM at this point?

You can check the top of your KSP error.log, and it should show RAM usage at the time of crash.
/AppData/LocalLow/Squad/Kerbal Space Program/Crashes

I have 32GB of RAM. I mostly suspect RAM because the loading time increases the more mods I have, and the loading time decreases by around 30% when I uninstall MemGraph. (Which is a mod that fixes RAM garbage collection.) However I can't play the game without MemGraph, because without it I get lag spikes every 5-10 seconds.

I just checked my error.log, looks like all of my crashes are due to an "mono.dll caused an Access Violation (0xc0000005)" error, which I looked it up and that is linked to outdated mods. I'll go through my mods and see which one might be causing it.

4 hours ago, Geonovast said:

I wouldn't say the game running on Linux magically fixes any memory problems.

We definitely need more information.  If you're paging a lot to an older, slower, and/or dying mechanical HDD, there could be your issue.  Linux won't help that.

Ah sorry, should've posted my specs. I have 32GB of RAM, an i5-8600k, and I'm running KSP on an SSD. I am on KSP v1.5.1 running around 34 mods.

Link to comment
Share on other sites

That doesn't seem like a heavy load, I run twice the mods you do on 1.3.1 and memory usage is nowhere near 32gb.
One thing to check is what size is your windows paging file? Having it set too small can cause weird slowdown.

 

Link to comment
Share on other sites

1 hour ago, The_8_Bit_Zombie said:

Ah sorry, should've posted my specs. I have 32GB of RAM, an i5-8600k, and I'm running KSP on an SSD. I am on KSP v1.5.1 running around 34 mods.

WOT!!???

thats like a supercomputer... you got a bad mod in there somewheres...
I cant imagine even a heavily modded install running out of *THIRTY-TWO* GB of RAM... vOv

Link to comment
Share on other sites

5 minutes ago, Stone Blue said:

I cant imagine even a heavily modded install running out of *THIRTY-TWO* GB of RAM... vOv

Highest I ever hit was just shy of 21 gigs.  After I updated to 32GB, I actually shut off my swap space... I'm not a fan of swapping.

Edited by Geonovast
Link to comment
Share on other sites

17 hours ago, The_8_Bit_Zombie said:

(Which is a mod that fixes RAM garbage collection.)

It doesn't fix anything. It'll just make the garbage collection cycles longer and that will fill up your RAM with more garbage.

You could try forcing the game to launch with opengl or DX11 to see if you can get around the old DX9 oddness of loading every texture twice.

15 hours ago, Geonovast said:

Highest I ever hit was just shy of 21 gigs.  After I updated to 32GB, I actually shut off my swap space... I'm not a fan of swapping.

Why not just reducing the swappiness to 0?

Link to comment
Share on other sites

2 hours ago, Harry Rhodan said:

Why not just reducing the swappiness to 0?

I was trying to think of a clever reason, but honestly it's just that when I was trying to see how to disable swapping, I found the tutorial on properly removing the partition, so I did that.  And then when I got my nvme SSD and re-installed, I just didn't install a swap partition.

For what I do with my computer, if it gets to the point that I'm maxing my RAM, something is wrong.  If I'm legit maxing my RAM... I'll buy more.

Link to comment
Share on other sites

Not related to the RAM issue you are having, but I'd still like to throw this bit in here:

KSP was the sole reason I switched back to Windows after many years... reason being the lack of joystick support. I could never see myself playing KSP without a joystick.

Like I said, not related to your issue, but still something worth considering IMO.

Link to comment
Share on other sites

1 minute ago, Dafni said:

reason being the lack of joystick support.

Seems like it would have been a lot less work to just install the AFBW mod that lets you use a joystick on Linux.  Or was that not an option?

Link to comment
Share on other sites

24 minutes ago, Geonovast said:

Seems like it would have been a lot less work to just install the AFBW mod that lets you use a joystick on Linux.  Or was that not an option?

True. But there was the short period of time, early 1.4.0 I believe, where AFBW was orphaned. Or I was not aware of it being updated right away. In hindsight a bit of the blame might also be attributed to my son's infectious addiction to PUBG :sealed:

Link to comment
Share on other sites

Silly suggestion -- but it sounds like you might be running the 32-bit version of KSP which has a 3.2gb ram limit?

32gb of ram should be way more than plenty for even super-highly modded installs.  But, if you are launching the 32-bit client, it has a limit of ~3.2GB ram usage, which will crash even with just the stock game.

If you look in the KSP folder, there should be two executables.  One for 32 bit (KSP.exe) and one for 64 bit (KSP_x64.exe, or similar; not at my game machine at the moment).  Run the latter one...  (and then make sure your Steam or other shortcuts are configured to run the 64-bit version as well).

Link to comment
Share on other sites

On 5/8/2019 at 12:28 PM, Stone Blue said:

WOT!!???

thats like a supercomputer... you got a bad mod in there somewheres...
I cant imagine even a heavily modded install running out of *THIRTY-TWO* GB of RAM... vOv

 

On 5/8/2019 at 12:33 PM, Geonovast said:

Highest I ever hit was just shy of 21 gigs.  After I updated to 32GB, I actually shut off my swap space... I'm not a fan of swapping.

Yeah something's definitely wrong. I might be wrong about it being RAM overflow though. I've been doing a lot of testing and I think I figured out part of the problem; my savegame. I launched a craft in a newly generated save and it took 12 seconds. Then, without changing anything, I launched the same craft in my main save and it took 60 seconds. My current best guesses for the cause of this are 1) The amount of crafts I have saved in the VAB/SPH, and 2) The amount of crafts I have that are currently flying. (E.g. accessible through the tracking station.) I counted and I have 200 craft files in the VAB, and 185 craft files in the SPH. I also counted the amount of vessels (including flags and debris) in the tracking station, which totaled to 254.

I managed to cut the loading time in half (down to about 34 seconds) by removing ALL of my craft files from the VAB and the SPH, but I need the crafts to play the game. I also cut the active vessels down to around 150, which reduced the loading time to ~26 seconds. But I want to continue to play on that save, which would mean adding more crafts and more vessels. Hopefully a memory leak is causing this, and it isn't just the norm when you have this many vessels/craft files.

 

3 hours ago, Shadowmage said:

Silly suggestion -- but it sounds like you might be running the 32-bit version of KSP which has a 3.2gb ram limit?

Nah that's not a silly suggestion. I'm running the 64 bit version. (The x64.exe one)

 

On 5/8/2019 at 11:22 AM, Flibble said:

That doesn't seem like a heavy load, I run twice the mods you do on 1.3.1 and memory usage is nowhere near 32gb.
One thing to check is what size is your windows paging file? Having it set too small can cause weird slowdown.

Thanks for the suggestion. I followed what you said and changed my paging file because it was set pretty low. (800mb) I changed the minimum file size to 5,000mb, and the maximum to 10,500mb. Unfortunately it didn't fix the issue.

 

13 hours ago, Harry Rhodan said:

You could try forcing the game to launch with opengl or DX11 to see if you can get around the old DX9 oddness of loading every texture twice.

Thanks for the suggestion. I tried running KSP with opengl. It cut the RAM usage down by 1GB, which is awesome! Unfortunately it didn't fix the loading issues, although it should hopefully help.

10 hours ago, Dafni said:

Not related to the RAM issue you are having, but I'd still like to throw this bit in here:

KSP was the sole reason I switched back to Windows after many years... reason being the lack of joystick support. I could never see myself playing KSP without a joystick.

Like I said, not related to your issue, but still something worth considering IMO.

Good point. I do use a joystick every once in a while, so I'll definitely take that into consideration if I decide to switch to Linux.

Link to comment
Share on other sites

On 5/9/2019 at 3:59 PM, Geonovast said:

And then when I got my nvme SSD and re-installed, I just didn't install a swap partition.

I don't know what your using but Ubuntu derivatives will still create a swap file instead.

Link to comment
Share on other sites

17 hours ago, The_8_Bit_Zombie said:

I also counted the amount of vessels (including flags and debris) in the tracking station, which totaled to 254

The number of vessels in space will impact the game performance pretty bad and 254 is already a lot. Recently, I saw a stream where the game took like 5min to load a new scene and finally refused to load at all because there was a telescope in space to track new astroids. Every astroid is a new vessel and if you keep tracking new astroids and do some time warps, the number of vessels/astroids can jump up to 1000+ very quick and even though these are just on-rails calculations, at some point it will break the game.

So... what happens when you create a new game, does it still takes an eternity to load?

Link to comment
Share on other sites

2 minutes ago, 4x4cheesecake said:

The number of vessels in space will impact the game performance pretty bad and 254 is already a lot. Recently, I saw a stream where the game took like 5min to load a new scene and finally refused to load at all because there was a telescope in space to track new astroids. Every astroid is a new vessel and if you keep tracking new astroids and do some time warps, the number of vessels/astroids can jump up to 1000+ very quick and even though these are just on-rails calculations, at some point it will break the game.

So... what happens when you create a new game, does it still takes an eternity to load?

Thanks for the info. Man that really sucks that even on-rail vessels contribute so much to craft loading times. My goal in my career save is to have crafts on every planet, so it's only going to get worse.

When I launch a craft in a newly generated save it only takes 12 seconds to load.

I think what I'll try is loading a backup of my career save in stock KSP. If the stock game launches crafts quickly even with 250 vessels, then hopefully it's a mod causing the issue.

Link to comment
Share on other sites

27 minutes ago, HebaruSan said:

I believe the "revert to VAB" option is implemented by creating a backup save file, and save files contain all the active crafts.

Ah that makes a lot of sense! A lot of my crafts have very long parts lists too, which can't help for backup save files. I wonder if there's a workaround for this.

I just tried launching a craft in stock KSP with ~300 vessels in the tracking station. It took 75 seconds, so the mods definitely aren't the main cause of the issue.

EDIT: I just tried launching the same craft in the same save again. It took 30 seconds this time, not 75. ¯\_(ツ)_/¯

Edited by The_8_Bit_Zombie
Link to comment
Share on other sites

  • 2 weeks later...

I have the exact same problem with 32gb ram and i7 6800k monster pc setup. I start all the careers butter smooth and as i have more active vessels in space and more vab vessel saves the game starts to stutter like crazy and load times increase. I wish the game had a way to utilize all my RAM (32gb) rather than trying to GC and swap or whatever like so frequently... This is really frustrating as i want to have 1000s of vessel saves and active ships at one point.

Link to comment
Share on other sites

On 5/23/2019 at 8:26 AM, zakna2g said:

I have the exact same problem with 32gb ram and i7 6800k monster pc setup. I start all the careers butter smooth and as i have more active vessels in space and more vab vessel saves the game starts to stutter like crazy and load times increase. I wish the game had a way to utilize all my RAM (32gb) rather than trying to GC and swap or whatever like so frequently... This is really frustrating as i want to have 1000s of vessel saves and active ships at one point.

Yeah it's really annoying. I wonder if there's a fix for it, because it seems like this shouldn't be an issue. I might try reporting it to the KSP devs as a bug.

EDIT: It's already been reported, but it only has 5 votes and its priority is set to "low." To anyone who's reading this, please vote up this bug.

Edited by The_8_Bit_Zombie
Link to comment
Share on other sites

  • 1 month later...
On 5/10/2019 at 12:30 AM, Dafni said:

KSP was the sole reason I switched back to Windows after many years... reason being the lack of joystick support. I could never see myself playing KSP without a joystick.

What lack of joystick support? I have a Logitech joystick and with flavours of Ubuntu I plug it in and it just works. 

Link to comment
Share on other sites

51 minutes ago, Kaa253 said:

What lack of joystick support? I have a Logitech joystick and with flavours of Ubuntu I plug it in and it just works. 

Linux joystick support has been broken in KSP since 1.4.  It's not Linux's fault, it's KSP's, so it should work fine in other things.

You're telling me you're using a joystick in KSP 1.4 or higher without the AFBW mod?

Link to comment
Share on other sites

19 hours ago, Geonovast said:

You're telling me you're using a joystick in KSP 1.4 or higher without the AFBW mod?

No I am telling you I have not plugged in my joystick since KSP 1.4. I am horrified to hear any news at all about any reduced functionality for the KSP Linux version compared to Windows and OSX. This news to me is just bad, very bad. It doesn't matter that I prefer not to use the joystick, other people want it so it must be supported. Very sad and unsettling to hear it!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...