Jump to content

[BUG] Memory Leak Flying Near Ground


Recommended Posts

KSP Version: v0.90.0.705 Beta Windows 32-bit

What Happens: KSP.EXE continues to take more and more memory when flying very close to the ground.

Mods / Add-Ons: All Stock

Steps to Replicate:

  • Bring up Taskmgr.exe and set it to always be on top (in options).
  • In Taskmgr, sort by memory, and KSP.exe will be at the top.
  • In KSP, Create a simple plane with enough fuel to fly long distances at low altitudes.
  • Take off and fly within a km of the ground for a while.
  • Watch the memory climb in Taskmgr and never go down.
  • Climb up above 10km
  • Watch memory usage rise slow, then stop, but not go back down.
  • Go back down to 1km - Note memory use begins to rise again.

Fixes/Workarounds:

- None, other than don't fly close to the ground.

Other Notes/Pictures/Log Files:

- Seems to hold the memory even when leaving the save and loading a new one.

Link to comment
Share on other sites

Hmm. Good observation. This probably has something to do with the terrain loader, but I don't know any of the specifics. I'll see if I can point this out to someone who knows a bit more about it.

Cheers,

~Claw

Thanks, though I can't take full credit. One of my viewers (Liowen) noticed it when I was having crashing issues because I was running out of memory (I have lots of mods installed in that instance of the game, which makes reaching the memory limit with this memory leak easier). He thought it was due to terrain scatter, and so I ran two tests in a fully stock game. Memory usage went up with both tests. :)

Link to comment
Share on other sites

I have this issue too now, except in a rover. I landed my rover from orbit on Kerbin, as I had just done 15 minutes earlier, and my frame rate plummeted. If I looked in one direction I got 15-20, another direction got 30, and looking straight up or straight down got me 60. I noticed my memory usage was also growing quite fast for just being at Kerbin not moving at all. Then it just crashed... Does anyone have any fix for this?

Link to comment
Share on other sites

you are right, i have the same issue: i can play hours in orbi,t changing spaceraft,... without crash the program (2GO of memory use) but when i fly on kerbin the memory increasing slowly without going down and finaly it crash (time to go to south pole: 3GO>crash). 5thHorseman, i think u did a good and important observation.

Link to comment
Share on other sites

I recall this being an issue for quite some time; asmi reported it back in .23 or so IIRC. It does look like something involved with PQS leaks, or (since it appears to occur even just on revert to VAB/relaunch) like the cache is being expanded rather than reused.

Link to comment
Share on other sites

I recall this being an issue for quite some time; asmi reported it back in .23 or so IIRC. It does look like something involved with PQS leaks, or (since it appears to occur even just on revert to VAB/relaunch) like the cache is being expanded rather than reused.

That is very possible. I think the last time I flew anywhere on Kerbin that wasn't within sight of KSC was well over a year ago. It's just more important it gets fixed now because of all those survey contracts.

Link to comment
Share on other sites

Just got bit by this one doing a long recon mission, but only after going halfway around the world then turning north for a bit. With a mid-flight save, I can see the memory usage going from ~2GB on game load to ~2.5GB on save load, then steadily increasing during flight until the game crashes at ~3.5GB.

With the 64-bit executable, memory usage follows the same pattern, and has so far increased to ~5GB. I'll have to finish these contracts in 64-bit, hoping it doesn't crash too often.

There was no real difference between stock and modded (<10 mods), either.

Link to comment
Share on other sites

I'm fairly certain there is at least one more memory leak in KSP: just load stuff into the VAB/SPH a lot, switch scenes a lot, and you'll notice an upward trend in memory usage (in stock as well as modded). Sure, occasionally it will go back down some, but the trend is upward an out-of-memory crash is inevitable if you play long enough. Very irritating.

Link to comment
Share on other sites

i seen this plugin and thinking to u: it display the memory usage on screen:

http://forum.kerbalspaceprogram.com/threads/99494-0-90-MemoryUsage-v1-11-2014-11-19

does this mod increase the memory himself? :P

That mod uses very little memory. It just shows you information available with a program like Process Explorer on a HUD. The only benefit to the mod is if you have only one monitor, and can't watch process stats real time on a second screen.

- - - Updated - - -

It does seem to be related to terrain scatter. After disabling it and restarting, I no longer see uncontrolled memory usage when flying low.

Link to comment
Share on other sites

That mod uses very little memory. It just shows you information available with a program like Process Explorer on a HUD. The only benefit to the mod is if you have only one monitor, and can't watch process stats real time on a second screen.

- - - Updated - - -

It does seem to be related to terrain scatter. After disabling it and restarting, I no longer see uncontrolled memory usage when flying low.

Interesting! I recently turned my scatter density up to 100 and was getting lots of crashes too. I'll roll it back and see what happens. Good show, lads.

Link to comment
Share on other sites

Terrain scatter has been buggy since... forever. I can't say I'm entirely surprised it's causing some kind of memory leak... but I do wish they'd fix it. :D

Note: This happens with terrain scatter turned off, though it happens much faster with it on and turned up. I note that there is still some scatter in the game with it off (grass only, I think) which for all I know is what's causing it.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 2 weeks later...

I had a look at that this weekend. I left a ship flying on a low orbit around the Mun for 40 minutes. Terrain scatter was active and visible.

After a while the memory stop going up, so my guess is that there is some kind of large cache that fills up, not a real leak.

Link to comment
Share on other sites

I had a look at that this weekend. I left a ship flying on a low orbit around the Mun for 40 minutes. Terrain scatter was active and visible.

After a while the memory stop going up, so my guess is that there is some kind of large cache that fills up, not a real leak.

I wonder if you loaded every piece of terrain scatter on your orbit (was it equatorial?) so when it had to load it again it was referenced. This would make it not a leak, though still able to easily crash a machine if you have mods installed or jump to several planets in a single session.

Link to comment
Share on other sites

No, I truly think there is some kind of large cache that gets properly reused. The problem is that the Mun does not allow for a nice test (not flat enough, I kept hinting things while trying to find an alt where I saw the scatter and allowed for a full orbit).

I think I'll add some code to MJ plane AP to fly at a fixed ground, send the plane with infinite fuel and see if I can graph the memory.

Edited by sarbian
Link to comment
Share on other sites

  • 2 weeks later...

Uh, I was going to report the same stuff. Good that I had enough patience to look up some of the bugs reported already.

I receive the same issue, with some additional behaviors.

- the memory goes up even if I'm not within viewing-distance of the ground-scutter, but much more slowly.

- I think it reload all of the scutter arond the KSP everytime I switch from a building to the overview, or even try to launch... something (that KSP, so expect all kinds of launches)

- Speaking of the KSP - somehow it will recreate its geografic appeareance every time I switch back. Might be another bug, but I can see how it will add about 100MB RAM

- The whole game slows down while it keeps stuffing stuff in its RAM. Sometimes, when memory allocation exceed 3GB, it stats to get a pain in the youknow to build a vehilce, because you get a slight click-lag

- So, I did a visual survey of a area and all left is doing a EVA. Usually my planes "land" using parachutes, the Kerbal jumps out and it reches maximum memory allocation and crashes. If I reload, the whole area, which was a plain field before, is full of trees

Well... lets say, this is someting, Unity does cause. Maybe hard to fix. And so on. But I wonder, if there would be a possibillity to flush that clutter-cash when you hit the game's main-menu. Being forced to leave your game might be worse, but its way more favourable compared to a plain crash and beeing forced to reload again (which may take some time if you using mods).

Hopefully this will be adressed in future bug-fixing :) Until then, I will try to minimize the scutter.

Greetings, someone who just bombed his KSP into ground accidently using the biggest Fuel-Tank available.

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