Jump to content

Memory Leak question


Recommended Posts

First thing: No big deal, happens to a lot of us. Pretty sure a mod will relocate this thread even as I'm typing.

Second thing: There have been many conformations from squad that several memory leaks have been patched for 1.0. Most problems you have should be solved when it's out. If you are referring to how to find a quick fix, there's not much out there to "quick fix" a memory leak, unless you could identify the actually leak itself and fix it. If I were you, I'd just wait for next week to roll around.

Link to comment
Share on other sites

There are 2 things you can do to minimize the leak. Nothing will stop it though:

1) Turn off ground scatter. Just turn it off completely.

2) Don't jump around a lot. Like VAB->ship->SPH->launch->revert->SPH->launch->revert->etc. This one is of course hard to do, as it's a core way to play the game.

One more thing you could do, monitor your memory usage and close/restart the game when you get to about 3.5 gig.

Link to comment
Share on other sites

One more thing you could do, monitor your memory usage and close/restart the game when you get to about 3.5 gig.

Personaly I'd recommend a bit sooner than that. While a 32 bit program can technically handle up to 4gig for various reasons it will crap out a bit before that. I find that if the ram usage of ksp ever reaches 3.7 it will crash, do not pass go, do not collect any science. As scene changes tend to give a brief spike in ram usage leting it get to 3.5 frequently results in a crash the next time something happens. My rule is 3.3 is the cutoff for time to restart. Gives me a couple of scene jumps of leeway in case I miss it reaching that threshold to avoid crashing at an inopportune moment.

Still I agree, the only good solution is to either restart often or as the usage gets high. I've tried various ram cleaners to try and free up the unused ram that KSP thinks it needs but is really just leaked bits and bytes but they tend to only be a marginal stopgap and often result in instability. Also in the time they take to run and for KSP to settle after it reaquires whatever resorces it needed I could have just restarted anyway.

Link to comment
Share on other sites

Thanks for the replies. It seems I'm just going to have to bite the bullet and remove some mods. (I start up with 3.5GB use before I even start going).... I can't wait till 64 bit is finally supported...

You could also try just removing parts you never use and see how that goes. Might be a lot of work tho.

Link to comment
Share on other sites

Pretty sure it's been confirmed that the major leak from .90 has been fixed, as well as many others.

x64 is not going to be a thing, probably, until Unity 5 is running KSP and even then probably not on the first version on Unity 5. Which will probably happen, but may also be impossible or impractical as well. Myself, I'm not expecting Unity 5 until the KSP devs announce it (as in I'm not expecting it any time soon), and 64 bit I think will be approached with great caution for the second try.

1.0 also behaves a lot better with DirectX 11, which uses FAR less memory than DX9. Partly because it takes advantage of your video memory better. For me I can use either DX11 or OpenGL and DDSLoader and not need ATM with a pretty good mod load.

Also with better use of video memory is use of DDS in 1.0, which a lot of us have already been using and it does help quite a bit - game loads faster too.

1.0 is out early next week. So, I'd goof off this week in stock and start anew next week. Week after that hopefully most of the major mods should be up and running well.

I know that quite a few mods are going to have save breaking changes on 1.0. And it's not abnormal for them to have ship breaking changes (as in your craft files are no longer valid).

Link to comment
Share on other sites

I don't know how you all cope with a 3.5GB cap!

My start up hits around 6 GB. About 60 mods, fantastic render, full res, scatters enabled.

Linux, of course.

Mind, I still run active texture management and spend a lot of time sorting and removing unused parts.

Every new release has exhibited less lag. It is definitely improving.

I look forwards to even less or no memory leak/s at all and just imagine if Unity could use more than one core......

Edited by Kaa253
Link to comment
Share on other sites

I can't wait till 64 bit is finally supported...

Don't hold your breath on that, don't think it's even been mentioned as a thing that the devs hope will happen, let alone given a schedule.

Just to check, you are running in OpenGL mode aren't you? My game won't even load in DX9, but sits on the menu at 2.4gb in use with OpenGL, which is a good couple of hours gameplay before it needs a restart.

Link to comment
Share on other sites

Another good solution is to use ductape to patch any leaks

- - - Updated - - -

Don't hold your breath on that, don't think it's even been mentioned as a thing that the devs hope will happen, let alone given a schedule.

Just to check, you are running in OpenGL mode aren't you? My game won't even load in DX9, but sits on the menu at 2.4gb in use with OpenGL, which is a good couple of hours gameplay before it needs a restart.

Sorry mate, they said the very next update after 1.0 will be ported to Unity 5. They'd port 1.0 if it wasn't so far in dev when U5 came out

Link to comment
Share on other sites

How does the memory leaks appears ?

I usually have a bug when I load/switch a ship. The ship appear, then disapear immediatly and the screen is black (I still see the HUD, with NaN orbital speed) and event the animated Kerbals portraits. KSP is not crash of freezed but ultra laggy. I can get back to KSC, but I loose my ship.

I have to kill (not exit) the game and restart or I loose my ship. This bug even occurs right after reloading ; it's very random.

Mods : MechJeb, KER, AlarmClock

Is it a memory leak-linked bug or something else ?

Link to comment
Share on other sites

Well, the 'memory leak' is not a leak per se :)

It's just that in some cases, the game does not free memory it no longer needs. So when these unfreed memory starts to accumulate, while the game keeps requesting new free memory, you soon hit the 32bit memory limits (for the 32 bit client of course) once that happens, the OS will start using the hard drives as a cache, slowing down the game tremendeously (most os's aren't suited to address more memory than that) - or outright crashing the game.

As for the game cause, there's a variety of things that create those leaks, but generally, the bigger and more physics intensive the ships you load, the faster you'll hit the limits :)

Link to comment
Share on other sites

Pretty sure it's been confirmed that the major leak from .90 has been fixed, as well as many others.

x64 is not going to be a thing, probably, until Unity 5 is running KSP and even then probably not on the first version on Unity 5. Which will probably happen, but may also be impossible or impractical as well. Myself, I'm not expecting Unity 5 until the KSP devs announce it (as in I'm not expecting it any time soon), and 64 bit I think will be approached with great caution for the second try.

1.0 also behaves a lot better with DirectX 11, which uses FAR less memory than DX9. Partly because it takes advantage of your video memory better. For me I can use either DX11 or OpenGL and DDSLoader and not need ATM with a pretty good mod load.

Also with better use of video memory is use of DDS in 1.0, which a lot of us have already been using and it does help quite a bit - game loads faster too.

1.0 is out early next week. So, I'd goof off this week in stock and start anew next week. Week after that hopefully most of the major mods should be up and running well.

I know that quite a few mods are going to have save breaking changes on 1.0. And it's not abnormal for them to have ship breaking changes (as in your craft files are no longer valid).

So no more funny pink ships during reentry ? As I am using DX11 now with 0.90 and there are some bugs like Minmus not showing and those funny pink rockets :D

Did they fix this in 1.0 for DX11 ?

Link to comment
Share on other sites

Well, the 'memory leak' is not a leak per se :)

It's just that in some cases, the game does not free memory it no longer needs. So when these unfreed memory starts to accumulate, while the game keeps requesting new free memory,

That is actually the textbook definition of a memory leak.

you soon hit the 32bit memory limits (for the 32 bit client of course) once that happens, the OS will start using the hard drives as a cache, slowing down the game tremendeously (most os's aren't suited to address more memory than that) - or outright crashing the game.

The OS will not begin paging once the 32-bit limit is reached; the program will just crash instead. Paging is invisible to programs (other than slower fulfillment of page reads), and is a completely separate thing from the 32-bit limit.

Link to comment
Share on other sites

I know that was a textbook definition :) however, it's still useful to remind it in this kind of thread, so people understands what The thread is talking about :)

'Memory leak' being a bit of an obtuse term, which does not really describe what happens :)

With this kind of 'title' people who don't know what it is about may sooner think that the game is losing some of the assets it stored in the computers ram :)

Link to comment
Share on other sites

Sorry mate, they said the very next update after 1.0 will be ported to Unity 5. They'd port 1.0 if it wasn't so far in dev when U5 came out

I'd be delighted if this happens! Obviously I have missed that particular news :)

Link to comment
Share on other sites

The OS will not begin paging once the 32-bit limit is reached; the program will just crash instead. Paging is invisible to programs (other than slower fulfillment of page reads), and is a completely separate thing from the 32-bit limit.

That's right. In fact, in modern operating systems, "virtual memory" is used, which means as far as a process is concerned, it has the entire memory space available to it. It's the OS' job to foster that illusion. Paging only comes into play if you don't have enough physical RAM to store all the memory allocated to a process at once.

For this issue, a 32-bit space may be an advantage - if you have 6 GiB and are running only a 32-bit game (no other programs to juggle), it will only ever request <4 GiB, and you shouldn't ever need to have it paged. So memory leak causing a crash yes, but paging errors no.

Link to comment
Share on other sites

I'd be delighted if this happens! Obviously I have missed that particular news :)

There was a thread that had a poll (Port ksp to Unity5, Yay or nay?). One of the devs said that they'd port 1.0 if it wasn't so fat indev. Altough I could be wrong, so dont quote me on that.

Update:

Quote Originally Posted by Eric S View Post

I don't. The devs have stated that they're going to evaluate U5 after 1.0 gets out the door, and haven't contradicted that in any way. They've been repeating that 1.0 doesn't mean the end of new development and features. They may or may not prioritize U5 higher or lower than the features that they cut from 1.0, or they may stick them all into 1.1. They haven't said that they will definitely port to U5, but I suspect that that is because saying that before having the chance to evaluate the impact of U5. I strongly believe that the evaluation will come out in favor of U5 and that they'll do the port in 1.1 or 1.2.

and http://forum.kerbalspaceprogram.com/threads/113706-Squadcast-Summary-2015-03-20-Squadcast-is-back%21-IVA-s-April-Fools-and-Questions

CTRL+F for Unity 5

Edited by Anister
Link to comment
Share on other sites

Another good solution is to use ductape to patch any leaks

- - - Updated - - -

Sorry mate, they said the very next update after 1.0 will be ported to Unity 5. They'd port 1.0 if it wasn't so far in dev when U5 came out

You're not messing with me are you?... Right?? Right???

They did mention Multiplayer we have to remember, and there's no way a 32 bit KSP is going to be able to deal with multiplayer. They do need to bring it to 64 bit as soon as possible for their future dreams which they've already said they want to do happen.

Link to comment
Share on other sites

Its not that bad if you dont use scatters (i only turn that on when im taking screenies to post), and dont have many ram hog mods installed (B9, EVE, ect). The visual mods are my main issue, as i really like my clouds even when im not doing cinematic pictures, so i tend to stick to enabling those unless im playing DMP.

Really teh ONLY mod that i use ALOT and is an issue is DMP, that thing (on most servers where people have 300 craft loaded up) is a major issue, and i rarely get to play more then a hour even when i turn setting down to minimum. Then again, given the mem leaks, im guessing that mod's constant updating of the map is causing them lag and mem crashes. Still worth it even if i only get to shoot at stuff for a few minutes in one go (and then need to reconnect after).

Aside from that one mod, i never had any considerable memory leak issues, as i rarely play the game for more then 2 hours straight at a time (need to eat and i have an actual life too), so it just never gets to the point that i manage to give it time to build up the memory leaks.

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