Jump to content

KSP crashes after a few reverts or launches


Recommended Posts

  • 1 month later...

Yep, same exact thing here. Task manager shows 50 to 100 megabytes being added to memory usage with every revert.

Note that this only happens when the "revert" button is clicked, during the transitional loading screen. The launch button has no significant impact. "Rever to launch" is also fine. So for some reason assets used in the VAB/SPH are being reloaded every revert and not being cleaned up.

Having a few mods installed means base memory usage is higher (I have about 1.7 gig in use the first time I hit launch) which means you'll only get about a dozen reverts before the game runs out of memory and crashes.

Also, I am not using any of the mods you are using. In other words this does NOT look like a bug in any particular mod. This is a serious memory leak in either Squad's own code, or in some particular code that every mod uses (or in Squad's mod loading code).

Edited by allmhuran
Link to comment
Share on other sites

This seems to be related to the OS X memory issues I investigated recently in another thread.

Does memory usage keep increasing when you launch and revert the same rocket for multiple times, or does it only increase, if you keep adding new part types to the craft? I've got the impression that this is probably not a proper memory leak. It seems that the game caches a second copy of the assets that have actually been used, and then fails to clear the cache when the assets are no longer needed. As a result, the 4 GB memory limit (more like 3-3.2 GB on a Mac) not only has to be enough for preloading all assets on startup, but also for caching a second copy of them.

Link to comment
Share on other sites

I'm running the 32 bit windows version on windows 7.

The problem occurs after a certain number of reverts, depending entirely on how much overhead you have to begin with. Launches do not cause the issue. For me each revert consumes another 50-100 megabytes.

It does not matter whether it is the same craft being reverted over and over, or different craft each time.

It doesn't matter if you go to another scene (or even back to the main menu!!) in between reverts. The used memory is never freed.

The only way to proceed is to keep an eye on the memory and restart when you creep near 2.4 gig (or let the game crash).

Note that going from your flight back to the space center also consumes some additional memory, but it drops back down when you go back to a flight, and so there is no leak here. Repeated scene switches to the space center alone will not cause the issue. The same is true if you switch to the SPH/VAB and back to the space center over and over... there's no problem.

It's all about the "revert to VAB/SPH".

I've got the impression that this is probably not a proper memory leak. It seems that the game caches a second copy of the assets that have actually been used, and then fails to clear the cache when the assets are no longer needed

Haha, yeah... uh... that's exactly what a memory leak is. XD

Edited by allmhuran
Link to comment
Share on other sites

Note that going from your flight back to the space center also consumes some additional memory, but it drops back down when you go back to a flight, and so there is no leak here. Repeated scene switches to the space center alone will not cause the issue. The same is true if you switch to the SPH/VAB and back to the space center over and over... there's no problem.

If you launch and revert the same rocket multiple times, does the memory usage at launchpad keep increasing? Or is it always at the same level as during the first launch?

In OS X, the flight scene requires significantly less memory than the VAB scene. Memory usage goes down when you launch the rocket, but it still keeps increasing from launch to launch. On the other hand, if you launch the rocket and visit multiple planets, seeing each of them at different levels of detail, the game also caches those assets. As a result, you may also run out of memory during flight.

Haha, yeah... uh... that's exactly what a memory leak is. XD

If the game can reuse the cached assets (as it seems to do in OS X), it's not a memory leak, just bad memory management. It only becomes a memory leak, if the cached assets are not (or can't be) reused, and the game keeps caching new copies of them.

Edited by Jouni
Link to comment
Share on other sites

If you launch and revert the same rocket multiple times, does the memory usage at launchpad keep increasing?

Yes. It's really simple: Every time I hit "revert to VAB" or "revert to SPH", memory consumption increases by 100 meg or so, and this 100 meg is never freed.

If the game can reuse the cached assets (as it seems to do in OS X), it's not a memory leak

I suppose there is technically a difference between a pointer that gets zeroed out while pointing to used heap space which then prevents that space from being freed or reused, and a pointer that simply gets "lost" somehow which prevents that heap space from being freed or reused. BUT NOT MUCH. :P

Link to comment
Share on other sites

Yes. It's really simple: Every time I hit "revert to VAB" or "revert to SPH", memory consumption increases by 100 meg or so, and this 100 meg is never freed.

That's definitely different from OS X then. I can consistently get the game to crash after a few launch-revert-cycles, but only if I keep using different parts. Reusing the same parts doesn't affect memory usage after the first 1-2 launches.

I suppose there is technically a difference between a pointer that gets zeroed out while pointing to used heap space which then prevents that space from being freed or reused, and a pointer that simply gets "lost" somehow which prevents that heap space from being freed or reused. BUT NOT MUCH. :P

I'm talking about the difference between caching and a memory leak. It seems that the OS X version of KSP caches the used assets, and then reuses the cached assets when they're needed again. Meanwhile, the Windows version also tries to cache the assets, but it doesn't reuse them, and ends up leaking memory instead.

Link to comment
Share on other sites

Every so often when I revert or launch a plane/ship my game unexpectedly closes. It happens very often after about 6 or 7 launches or reverts. The crash log is here: http://pastebin.com/PDb2dzeP

The mods I am using are as follows: http://gyazo.com/0808fcb4c3800a78169d73ef89ea9116

I have exactly the same problem. Only different thing mine just once crashed during flight too. I tried to use active texture management but it just become worse with it, it runs a little longer but game started to crash unexpectedly with it. And Open GL doesn't work. I have 17 mods, mainly based on game play rather than parts. But I guess we have no solution for this problem :P

Link to comment
Share on other sites

  • 3 months later...

My gamedata directory is at about 850 MB. The interesting part is that the game only crashes when I play career. When I launch the game for the first time it works fine for some time. After it crashes I get a report that mono.dll caused a violent... When I check the memory it shows that there is only about 2 GB of it used by the game wich as far as I know is not even close to the RAM limit. When I try to launch again it crashes when it tryes to load the main menu. If I set the resolution from full to half it works fine for some time until it crashes again. I can load the game again and play the same amount of time before it crashes. Sandbox is as far as I see not afected. My computer specifications are: OS - Windows 8.1 Pro; RAM - 4 GB; Processor - Intel core duo 2.2 GHZ; Graphic card - Radeon 4600. I'm using kerbal space program 1.0.2.

Link to comment
Share on other sites

I have the same issue. I was running the game in Career mode on an older Win7 laptop. exact same mods, but the laptop had way less power. New laptop is Win 8.1. RAM-16 DDR3, Intel i7, GTX 965m. Runs great for a few launches, then crash. And error reports are always memory related.

Link to comment
Share on other sites

  • 1 month later...

Please read this for stock KSP issues reporting and this for modded issues reporting. It is very hard to get the cause of a crash just from a very brief explanataion.

Seeing your issues, I'd say that the cause of your crashes is running out of memory, KSP handles memory pretty bad, and you are often out of memory, crashing the game. This even happens with larger amounts of RAM.

Quick fixes are: lowering graphical settings, forcing KSP into OpenGL, or using Active Texture Management

Link to comment
Share on other sites

I get the exact same issue, *except* I don't even get one revert out of it before I get an out of memory crash.

The only mods I'm using that I have in common with the OP are Firespitter (I just use the DLL only as part of KSP Interstellar), MechJeb and CrossFeedEnabler.

I wonder what happens when you remove any of those mods.

Link to comment
Share on other sites

It is very hard to get the cause of a crash just from a very brief explanataion
Yeah, a log file from a crashed session would help.

But I'm pretty confident as to what you will find... OOM, due to a memory leak. It is, however, unlikely that the root cause will appear in said log, just the symptom - an Out Of Memory crash.

I'm seeing the same ~100MB increase in memory usage with each revert, but without the crash (x64 on Debian Jessie). There's nothing suspicious whatsoever in my logs.

Also, if this is what I think it is, it has been reported many times before.

Link to comment
Share on other sites

I get the issue described in the OP also, recently discussed in my post here

I installed this patch mod a week ago and my game has worked perfectly ever since.

http://forum.kerbalspaceprogram.com/threads/97285-KSP-v1-0-4-Stock-Bug-Fix-Modules-%28Release-v1-0-4c-1-22-Aug-15%29

I have that installed, and whilst it fixes some bugs really well, it has no effect on the scene-change-related CTDs.

Also, if this is what I think it is, it has been reported many times before.

If this is the case, was there ever any word on the likelihood of a fix?

Edited by p1t1o
Link to comment
Share on other sites

  • 3 months later...

All the speculation is fine, but does anybody have a way to fix the Goddamn Problem?!?!?

I have maybe 15 mods in, so my base memory is 100% or whatever. every time i try to load a quicksave or revert it crashes, leaving my saves practically unuseable. this honestly makes me want to throw my computer at someone until one of them breaks.

Edited by Andem
Link to comment
Share on other sites

24 minutes ago, Andem said:

All the speculation is fine, but does anybody have a way to fix the Goddamn Problem?!?!?

If it is indeed an OOM crash (and your logs will tell you), the only solutions I know of are: Use --force-opengl, use the unsupported Win64 hack, run on GNU/Linux, or wait for KSP v1.1 and the port to Unity 5.

Also, this is a rather old thread - I'm pretty sure the search feature (hopeless as it is) will reveal more recent discussions on the subject.

Link to comment
Share on other sites

10 hours ago, steve_v said:

If it is indeed an OOM crash (and your logs will tell you), the only solutions I know of are: Use --force-opengl, use the unsupported Win64 hack, run on GNU/Linux, or wait for KSP v1.1 and the port to Unity 5.

Also, this is a rather old thread - I'm pretty sure the search feature (hopeless as it is) will reveal more recent discussions on the subject.

Thanks. I think a big problem is that I don't have enough RAM, looking at task manager while KSP is running told me that KSP was trying to use 130% of my ram... I will try that too.

Link to comment
Share on other sites

16 hours ago, Andem said:

KSP was trying to use 130% of my ram...

The suggestions I made (with the exception of --force-opengl) are relevant only when it's the 32bit address space limit you're running into. How much physical RAM do you actually have? KSP really needs 4GB installed to run properly, given that the OS will also use some of that.

Link to comment
Share on other sites

4 hours ago, steve_v said:

The suggestions I made (with the exception of --force-opengl) are relevant only when it's the 32bit address space limit you're running into. How much physical RAM do you actually have? KSP really needs 4GB installed to run properly, given that the OS will also use some of that.

I have 4 gigs installed, and I have been planning on ordering 8 more gigs. I also plan to look into the openGL suggestion, as I have also seen it elsewhere on the forums... thanks! :D

Link to comment
Share on other sites

  • 4 weeks later...
On 3/28/2015 at 9:30 AM, Jouni said:

This seems to be related to the OS X memory issues I investigated recently in another thread.

Does memory usage keep increasing when you launch and revert the same rocket for multiple times, or does it only increase, if you keep adding new part types to the craft? I've got the impression that this is probably not a proper memory leak. It seems that the game caches a second copy of the assets that have actually been used, and then fails to clear the cache when the assets are no longer needed. As a result, the 4 GB memory limit (more like 3-3.2 GB on a Mac) not only has to be enough for preloading all assets on startup, but also for caching a second copy of them.

Mac has 8 gigs memory and ksp uses about 1 gig and when caches/assets are created, it over loads the memory

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