Jump to content

Determining a Memory Leak Culprit


Cornholio

Recommended Posts

Hello,

I have a heavily modded version of 1.2.1 that I want to start playing.  I totally understand and respect the posting logs part of problem solving and will definitely do it if another requests and wants to help but... I enjoy problem-solving on my own too.

I discovered that my game has a memory leak.  Using task manager, memory in KSP will continue to increase by about 200kb until it crashes due to reaching maximum computer memory.  I am running 64bit client on 64 bit windows with 16gb of ram.

Other than exhaustion and being sure that add-ons are up to date, are there any good methods anyone could suggest for figuring this out or reaching the solution faster?

Link to comment
Share on other sites

The game leaks memory regardless of what mods you have installed. This can easily be verified by linking a debugger to the process and creating and test-launching a bunch of crafts from the VAB when you already have ships/labs in the area. Every launch, regardless of whether you end up reverting it, leaves a bunch of objects that for some reason never get cleaned up. I'm not sure if Unity's garbage collection has caveats like lost references, or what sloppiness is the reason behind this.

Eventually it uses up all the memory and begins swapping, this is immediately noticeable as recurring frame-freezing. There's literally nothing you can do about this except terminate the game process, as this causes Windows to release all the allocations, cleaning up what Squad couldn't be bothered to.

Link to comment
Share on other sites

55 minutes ago, Hesperid said:

The game leaks memory regardless of what mods you have installed. This can easily be verified by linking a debugger to the process and creating and test-launching a bunch of crafts from the VAB when you already have ships/labs in the area. Every launch, regardless of whether you end up reverting it, leaves a bunch of objects that for some reason never get cleaned up. I'm not sure if Unity's garbage collection has caveats like lost references, or what sloppiness is the reason behind this.

Eventually it uses up all the memory and begins swapping, this is immediately noticeable as recurring frame-freezing. There's literally nothing you can do about this except terminate the game process, as this causes Windows to release all the allocations, cleaning up what Squad couldn't be bothered to.

Oh really?? Is this true?? Even for stock installs?? Even for 1.2.1?? Even after all this talk of leak fixing and code clean up etc???

I rarely get the chance to play more than 1hr in one single session these days, but I was starting to suspect something like this must still go on.

Will this ever get fixed then??

Link to comment
Share on other sites

Yes, there are memory leaks (and other effects that are described by lay-people as memory leaks though they aren't actually leaks) but statements such as:

3 hours ago, Hesperid said:

I'm not sure if Unity's garbage collection has caveats like lost references, or what sloppiness is the reason behind this.

...imply to me that you don't have enough knowledge of the subject to be apportioning blame to anyone in particular.

3 hours ago, Hesperid said:

...what Squad couldn't be bothered to.

I have to assume that you have virtually no experience of software development as it is insulting to suggest that any developer would release a program that knowingly includes a memory leak because they "couldn't be bothered" to fix it.  It's far more important to fix issues that cause the game to crash or cause other game-breaking issues than it is to fix a gradual rise in the memory usage of a program that will eventually cause a crash.

Also:

2 hours ago, Hesperid said:

if you're at version 1.2+ and your patch notes are still talking about memory leaks...

[citation needed]  Where in the release notes for 1.2 or 1.2.1 does it mention memory leaks?  Before you reply, bear in mind that excessive garbage creation is not a memory leak...

Edited by Padishar
Link to comment
Share on other sites

On 11/22/2016 at 5:44 PM, sh1pman said:

I just restart KSP every hour or so to avoid stuttering and frame-freezing. It's not much of a problem, really. 

I do that too and it's not as cumbersome since KSP loads faster now, although I can't leave it running overnight like I used to. I just thought we were past all of that 'how to deal with a memory leak' issue. 

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