Jump to content

Absurd memory usage (24GB) on Linux with JNSQ and others


Recommended Posts

I am experiencing some profoundly absurd memory usage from my KSP install. After setting it up, the game would refuse to load since the oom-killer would get it, although I got it playable by adding 16GB of swap. During gameplay, virtual memory usage is ~24GB or so, but the game is swapping enormous amounts of data to disk every time I change scenes. I'm guessing there's some sort of mysterious memory leak, but I'm not sure to troubleshoot it and I'm not sure if it's an issue with the game or Arch Linux. Normally, I would chalk such an enormously high usage up to this particular combination of mods; however, my roommates (three of them) are running an identical install on Windows and use approximately 4-6GB of memory. Something is uniquely wrong about my install, and I'd like to work out what it is since at the rate the game swaps out when changing scenes my SSD will be dead within the month.

 

Here's some information:

Distro: Arch Linux, Ryzen 2600 on 16GB RAM
KSP: 1.12.2, 64-bit.
Player.log: https://mega.nz/file/LYB2kToL#USYiVe0_3Hsjmf_CkpvtF6PcJyrRVNudIei6K7ScvDc
(not entirely sure why it ends with a crash, but I did actually exit the game...)
Mod list: https://pastebin.com/3i4QyDR0

 

I'm guessing that this issue is most likely caused by some unhealthy interaction between two mods, but that's just speculation. Anyone here have any ideas, or have experienced anything similar? I've got no idea what's going on but would like to play the game without waiting two (2) minutes at every scene transition for my computer to swap 8GB to disk and back.

Link to comment
Share on other sites

Those sound like the sort of numbers I’d expect for a heavily modded game- in fact I regularly get even worse memory use and load times when using the extremely modded RSS/RO/RP-1. You can reduce both memory use and load times by cutting down on mods, especially parts mods and especially those with detailed interiors- they use a lot of memory when a vessel is loaded but unless you’re a die-hard IVA fan they’re usually not what you’re interested in. The key is to be utterly ruthless- unless you absolutely must have a certain part in your game, delete it and save yourself a bit of memory; likewise any mods you don’t have a critically important use for, get rid of them.

The same holds true for load times, only it’s active vessels you should delete- a save file can quickly bloat to be millions of lines and many megabytes in size, which must be read and written in full when loading/saving the game or changing scenes. Any vessels which have finished their missions or which you don’t really need to keep should be terminated to make your save file smaller and thus make load times slightly less slow.

Link to comment
Share on other sites

20 minutes ago, jimmymcgoochie said:

Those sound like the sort of numbers I’d expect for a heavily modded game- in fact I regularly get even worse memory use and load times when using the extremely modded RSS/RO/RP-1. You can reduce both memory use and load times by cutting down on mods, especially parts mods and especially those with detailed interiors- they use a lot of memory when a vessel is loaded but unless you’re a die-hard IVA fan they’re usually not what you’re interested in. The key is to be utterly ruthless- unless you absolutely must have a certain part in your game, delete it and save yourself a bit of memory; likewise any mods you don’t have a critically important use for, get rid of them.

The same holds true for load times, only it’s active vessels you should delete- a save file can quickly bloat to be millions of lines and many megabytes in size, which must be read and written in full when loading/saving the game or changing scenes. Any vessels which have finished their missions or which you don’t really need to keep should be terminated to make your save file smaller and thus make load times slightly less slow.

This is exactly what I expected, and would be my normal course of action, had I not had two identical (or nearly identical) installs on my roommate's machines that did not experience nearly as high a memory usage. The problem is unique to this install, for some reason.

I was actually able to greatly reduce startup memory by (I think?) removing DarkMultiPlayer -- perhaps it was causing problems. However, there's still a massive memory leak remaining as usage increases over the course of a few hours of gameplay. I'm not sure what tools exist to identify leaks (by mod would be amazing) except perhaps MemGraph.

Even with this many mods, the game is still allocating 2-3x its size on disk in memory. Even accounting for the incredible waste of garbage collected languages that's still crazy amounts of usage.

Maybe it is just the number and scope of the mods, but I've got a feeling that its something using far more than its fair share that I'd like to specifically eliminate.

Link to comment
Share on other sites

18 hours ago, waterlubber said:

This is exactly what I expected, and would be my normal course of action, had I not had two identical (or nearly identical) installs on my roommate's machines that did not experience nearly as high a memory usage. The problem is unique to this install, for some reason.

They obviously are not identical.

So, first thing would be to copy over one of those installs onto your laptop and see what happens.  Until you do that, you have nothing to compare

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...