Jump to content

Memory Leak?


Recommended Posts

Ok i am slowly getting going in my mod heavy career, however i notice my RAM usage is slowly rising, i am not sure how, i have active texture management installed (x86) and i am running with an Nvidia 670, 8gb RAM, overclocked i5, so im guessing memory leak yes? Also i have -forec-opengl-popupwindow on my .exe, although im not so sure if it does anything to be honest with -popupwindow on the end. Looks terrible without it though.

Link to comment
Share on other sites

I don't think -popupwindow helps memory, but it does allow you to alt-tab away from the game without crashing.

And yes, I am also convinced that the current version has a memory leak. It leaks more when you're close to the ground (Kerbin for sure, but I think all worlds cause it) and it leaks more when you have terrain scatter turned on, but there is a definate, persistent leak that will crash ANY game - even a fully stock one - after a while.

Modded games just see it more often because they start out using more memory.

Link to comment
Share on other sites

I start at 2.1GB of RAM used and every time I load vessels in the VAB/SPH, switch scenes, or really do anything (you know, play the game), memory usage goes up as a trend - at certain points, what I assume is what other people have called "garbage collection" (not a programmer) does reduce RAM usage momentarily. But the trend is always upward. Even starting as low as 2.1GB, I can't really play for more than 45 minutes if I am regularly switching between vessels, launching new ones, etc.

The same thing happens on stock, it just takes longer to crash because memory usage starts lower. Dear Squad: please fix this ASAP!

Edited by AccidentalDisassembly
Link to comment
Share on other sites

I have been running into the same problem. Spent the last two weeks compiling mods, resolving conflicts within the mods, making sure I am at an accetable ram usage both while loading the game up and while doing something complicated like launching a vessel with 300 parts. My RAM never went over 2.5 gigs in heavy situations. So I decided, ok cool.... I can start playing for real now...After about an hour of play I alt tab after a few launches of super tiny early game vessels and my ram is at 3.4 gigs! Where did the extra 1 gig come from!?

Link to comment
Share on other sites

It cannot be overstated how much faster the leak is with terrain scatter and low flying. Turn scatter off completely (requires restarting the game), and the leak will be slow enough that you can fly around the world several times before having to restart.

Link to comment
Share on other sites

I wondered why I was crashing and I kept removing mods until I was left with what I have, only to still crash...

So this is why I've been crashing frequently despite having few mods and a significantly smaller game data size than previous iterations, because of this apparent memory leak. I have been tracking my RAM usage too all the time and it seems to inevitably go higher as I travel from scene to scene, up to the point where it reaches 3Gigs plus and crash.

any idea when it's gonna be fixed?

Link to comment
Share on other sites

I play with a lot of mods and have had memory leaks the whole time. I just live with them. I keep resource monitor open on my second monitor and when ksp gets around 3.5 gigs(usually a couple of hours) I restart the game. Just one way to work around it. HTH

Link to comment
Share on other sites

I am positive SQUAD is aware of this issue and it will be fixed soon. For now the only thing you can do is watch your RAM usage and when you get above 3 gigs just save and restart.

What makes you say that? Have they said something? And I can only wonder what "soon" means...

Link to comment
Share on other sites

This is a cross platform issue - I'm running the 64 bit Linux executable and everything runs smoothly while sitting at 4.6 - 5.2Gb memory usage, until I start flying low altitude over any celestial body, whereupon the memory usage jumps in 0.5 - 1Gb increments every 30-60 seconds until all 16 gigs of memory is full and the swap file starts filling up in a similar manner (just exited with ksp using over 30Gb of ram and swap!)

Like has already been said, turning terrain scatter off increases the time before the spikes begin, but doesn't eliminate the problem.

The only solution I've found is to keep an eye on the memory usage, and when it starts to spike, save and restart. Luckily it doesn't crash in Linux, just temporarily freezes, so it's more of a severe annoyance rather than making the game unplayable.

Any news on when this issue may be resolved?

Link to comment
Share on other sites

Having the same problem. For example, I loaded the game today with an initial 2.5 GB RAM usage, loaded the VAB, alt-tabbed out for a few minutes, and when I came back memory usage was already up to 2.9 GB, never dropping. Obviously something is causing C#/Unity's garbage collection to not work properly. It's really annoying for someone like me who does multiple missions simultaneously and having to jump back and forth between a good number of vessels in one sitting. This really needs to be addressed before they release 1.0. Although off-topic, this is one of many reasons they need more beta releases, so that they can find these game crippling bugs, attempt to fix them, and make sure that it is fixed after releasing it to us early access players. Bugs like this on release will damage Squad's and KSP's reputation.

Edited by sjohnson0684
Link to comment
Share on other sites

My game crashes in the editor... It's worse when I MAke custom wings but also happens on rockets, I'm modded at first I thought my mods were using all my memory but Could this memory leak cause this... Unity Player [version: Unity 4.5.5f1_7684ad0c5a44]

mono.dll caused an Access Violation (0xc0000005)

in module mono.dll at 0023:1011926a.

Error occurred at 2015-01-28_000644.

C:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\KSP.exe, run by User.

66% memory in use.

0 MB physical memory [2744 MB free].

0 MB paging file [0 MB free].

0 MB user address space [100 MB free].

Write to location 00201000 caused an access violation.

This is just the report from 1 of many crashes since 0.90.... it also happened after a fresh Install so am I safe to assume it's ksp itself and not my mods or anything I did?

Link to comment
Share on other sites

I am having the same problems. I really do hope that SQUAD will fix this in next version.

I am not happy that I have to count how many times I can do launch / revert to VAB or switch between my ships till I crash.

I started on the KSC screen with 2,2GB of memory. And after a few of this launch / revert to VAB or switching between ships and my memory is 2,8GB.

Really hope they will fix it. I am slowly loosing fun and joy and interest in playing KSP because of this bug :(

Edited by Jovzin
typos crap
Link to comment
Share on other sites

I am on having the same problems. I really do hope that SQAD will fix this in next version.

I am not happy that I have to count how many times I can do launch / revert to VAB or switch between my ships till I crash.

I started on the KSC with 2,2GB of memory. And after a few of this launch / revert to VAB or switching between ships and my memory is 2,8GB.

Really hope they will fix it. I am slowly loosing fun and joy and interest in playing KSP because of this bug :(

Same here but I do think they will fix it squad probably realize by now it's game breaking so I'm willing to bet they are working on it as we speak. I hope they release a patch b4 next release though! but we have to remember the game is very much so beta!

Link to comment
Share on other sites

Seem to be very much what I experience ... because I notice when I tweak stuff a lot I get a crash I can replicate it every time.

Also if I Select the craft and Flip it around a lot in the SPH and VAB I get a crash sometimes.... but that one I can't replicate.

Link to comment
Share on other sites

That may be a separate issue that compounds the memory leak. The VAB/SPH scenes in general cause a memory leak for me, i.e. just loading them and doing absolutely nothing causes KSP's memory usage to gradually increase (I checked the debug logs and I'm not receiving any log spam or exceptions). It's not limited to the VAB/SPH though, as it happens with switching other scenes or switching directly from one vessel to another, but not as bad it seems. Another memory related complaint is: http://forum.kerbalspaceprogram.com/threads/105514-BUG-Memory-Leak-Flying-Near-Ground. The game just needs proper optimization, and I hope they have enough internal testing to accomplish this if they continue to forgo more public beta releases.

Also, forcing OpenGL seems to help reduce the rate of the memory leak for me, although I have the occasional graphics glitch and FPS drops.

Link to comment
Share on other sites

Even as a new player, I can report the same thing here.

With ATM aggressive + DDSloader + forced d3d11, KSP starts out with ~2.78Gb ram on main menu and ~2.85Gb on Space Center.

While building/loading a craft in VAB, my ram usage shoots up to around the ~2.9Gb mark. When launching it increases again to ~3.0Gb +/- 0.7 depending on the craft complexity.

Now the worrisome part: reverting back to VAB/Space Center/quickload, does not seem to unload the previous scene from ram and relaunching does not seem load this previously cached scene still in ram. There are more instances in KSP where this happens.

To me this seems, what I heard and understood from friends who do programming: is that this Unity4.x implementation has very poor and non intelligent garbage collection.

That, or parts/textures/data etc are not correctly flagged in the code garbage collection, thus the garbage collector does not recognize them and that results in a steady climb of memory usage. Albeit: a memory leak.

As a newly player to KSP, I was shocked they wanted to go to a 1.0 release.

Without the above being fixed (good working garbage collection), even without good x64, 1.0 will be devastating for the game.

Edited by Gkirmathal
reformulated a sentence
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...