Jump to content

Memory Leak -- somewhere


mjl1966

Recommended Posts

I don't have a whole lot of helpful specifics, but thought this is something the community might want to look at.  Basically, there is a memory leak between the interior of the VAB and elsewhere.  When I start out in the VAB, with the current mods I have installed, KSP is taking about 3G of memory.  That's a lot to begin with.  After I work on something for a while, it's up to just under 3.5G.  So, it stands to reason that the additional memory is taken up by parts I'm using to assemble my craft.  However, when I leave the VAB, memory is still hanging in at ~3.5.  In fact, it goes over 3.5 while loading the main facility screen and then drops back down to where it was in the VAB.  Going all the way back to the main screen doesn't even help.  Once the memory use goes up, it doesn't seem to come back down.  Assets are not releasing memory when they go out of scope.

Bottom line: memory is not being cleaned up between the different levels.  Is this a Unity thing?  A SQUAD thing?  A mods thing?  I don't know.  But I do know that it just makes an already delicate memory problem even worse.

Edited by mjl1966
Link to comment
Share on other sites

Unfortunately you've reached that upper limit where you're going to be crashing constantly, garbage collection problem or no. There are a few limited things you can do outside of using Linux for 64bit or the "community hack". Using the community hack is kind of like drilling holes in your head to cure a headache though. If you use it and mods break, expect no support.

I'd suggest turning your texture quality to medium in the graphics settings as a first step.

You can also try to manually prune some of your mods (get rid of the parts you don't use, but that consume memory), but the difficulty of doing so varies tremendously with the mod (for example, trying to prune Ven's Stock Revamp is something akin to actual rocket science).

Then you can try the following (pulled from: http://forum.kerbalspaceprogram.com/index.php?/topic/90151-105-realism-overhaul-v1072-dec-17/&do=findComment&comment=1524562):

!BACK UP YOUR SAVES BEFORE TRYING ANYTHING!

On ‎11‎/‎13‎/‎2014 at 6:02 PM, Felger said:

Follow these steps to set launch options for Kerbal Space Program to reduce RAM footprint and allow alt-tabbing while loading:

 

  1. Edit settings.cfg in the root KSP install folder, change FULLSCREEN = True to FULLSCREEN = False
  2. Create a desktop shortcut for KSP.exe
  3. Right click on it, and open up the properties of that shortcut
  4. Add -force-opengl -popupwindow following the path to your KSP.exe.
  5. Launch the game, if you get graphical glitches (My text is glitchy with -force-opengl) try:
  6. Replace with -force-d3d11 -popupwindow in the path to your KSP.exe.

     

    In the end, your Properties window should look like one of these:
     
    Oemlrlq.png

Be aware the d3d11 fix has reportedly caused save file corruption, so I reassert:

!BACK UP YOUR SAVES BEFORE TRYING ANYTHING!

Edited by Randazzo
Link to comment
Share on other sites

4 hours ago, Randazzo said:

Unfortunately you've reached that upper limit where you're going to be crashing constantly, garbage collection problem or no. There are a few limited things you can do outside of using Linux for 64bit or the "community hack". Using the community hack is kind of like drilling holes in your head to cure a headache though. If you use it and mods break, expect no support.

I'd suggest turning your texture quality to medium in the graphics settings as a first step.

You can also try to manually prune some of your mods (get rid of the parts you don't use, but that consume memory), but the difficulty of doing so varies tremendously with the mod (for example, trying to prune Ven's Stock Revamp is something akin to actual rocket science).

Then you can try the following (pulled from: http://forum.kerbalspaceprogram.com/index.php?/topic/90151-105-realism-overhaul-v1072-dec-17/&do=findComment&comment=1524562):

!BACK UP YOUR SAVES BEFORE TRYING ANYTHING!

Be aware the d3d11 fix has reportedly caused save file corruption, so I reassert:

!BACK UP YOUR SAVES BEFORE TRYING ANYTHING!

...Or, if you're running Mac, you already use OpenGL...

Link to comment
Share on other sites

6 minutes ago, CliftonM said:

...Or, if you're running Mac, you already use OpenGL...

Since one may now safely assume you're running Mac, what helpful suggestions might you have to offer to others running Mac (in terms of memory problems - also assuming Macs have them)?

Edited by Randazzo
Link to comment
Share on other sites

1 hour ago, Randazzo said:

Since one may now safely assume you're running Mac, what helpful suggestions might you have to offer to others running Mac (in terms of memory problems - also assuming Macs have them)?

There is a 64 bit hack for Mac as a downgrade from x86.  I also recommend using Activity Monitor to kill certain background precesses.  You can't kill ones that you need, either.  They just go right back.

Link to comment
Share on other sites

Some time back (0.9.0 days?) I tried to locate the mod(s) that were causing problems. I repeatedly removed half my mods until the problem stopped. It didn't stop even with a fresh unmod'ed install. I was using the Windows resource monitor to watch memory usage slowly creep up - when it got to around 3.1 or 3.2 GB I knew a crash was immanent. The farther I was from 3.2GB at the start the longer it would take to reach the crash zone. I don't know if this is a Unity issue or a KSP issue. I ended up using the -forceopenGL and pruning unused parts and tossing some of the heavy memory mods (see Randazzo's post above) . Sorry - this probably wasn't what you wanted to hear.

Edited by wasml
Link to comment
Share on other sites

No they still have not fix this bug.    Alongside win 64 bit support this bug has caused more frustration, anger and fights here on the forum than any other topic. It is very probably one of the oldest bugs if not THE oldest bug in the game.  I believe this is because it stems from unity 4, at Least I hope it does!  Since unity 5 is only a month or two away lets hope that will be the last we see of the Ye Old Memory Leakage.

 

Link to comment
Share on other sites

All good stuff.  Thanks fellas.  I've trimmed back to the mods I only absolutely must have.  There's only 39 of them.  The biggest fix was uninstalling texture replacement.  That gave back a good 500M.  At this point, game starts at 2.7 and creeps up from there, so I just manually restart when it's around 3.4G and I'm getting ready something important.  I still need to talk to Steve to see if he has any special ideas. 

Meanwhile, I guess we wait for Unity to get it together with memory management. 

Link to comment
Share on other sites

25 minutes ago, mjl1966 said:

Meanwhile, I guess we wait for Unity to get it together with memory management. 

Provide a proof that it is a Unity problem first. Because "I  believe" is not a proof. 

Link to comment
Share on other sites

On 12/22/2015 at 4:08 AM, sarbian said:

Provide a proof that it is a Unity problem first. Because "I  believe" is not a proof. 

I used the word believe precisely because I do not have proof.  I could be and very probably am, based you your comment, wrong.  The problem could be squads, it could be Microsoft's for all I know. Though I thought I read the other operating systems are experiencing the same problem which means it probably is not microsoft's problem. I really thought Squad would have squashed it by now if it was their coding that was the problem. Thus for me all that was left was Unity 4.  I was trying to be an optimist, since if the problem is in Unit 4 then it very probably would go away in Unity 5.

Edited by mcirish3
Link to comment
Share on other sites

It's essentially a problem with Squad having no idea what Unity does.. and Unity clueless about cross platform interoperability (hence ever increasing versions).

If Unity ever bothered to consult pass histories about cross platforms... they'd realise it was a dead end... but Squad are still blind to that..

So they're reduced to a basic 'C' platform... Wow!! for performance here... we'll wait for the next hyperventilating processor.. :-)

Edited by ColKlonk
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...