Jump to content

Slight freeze every 5 seconds (or so)


Recommended Posts

@Padishar

Does NOT seem to be MJ. I've installed MKS to disassemble the MJ-Parts via EVA. Then I removed MKS+MJ (only Squad+MemGraph left in GameData).
Then I've created a new sandbox and copied the vessel to the new persistent file... Result: Still 30MB/s.
Is 30MB/s expected on a 250 part vessel?

 

TKWtwlK.png

 

Edited by Jebs_SY
Link to comment
Share on other sites

1 hour ago, Jebs_SY said:

Is 30MB/s expected on a 250 part vessel?

No, it isn't.  I don't get anywhere near 30 MB/s.  Can you try it without opening the debug console window at all?  How about in a new save with just a Mk1 pod on the launch pad?

Link to comment
Share on other sites

@Padishar

700kb/s for a pod on the launchpad. It starts to raise to ~30MB/s when loading the Odysseus2 ship from Kerbital's savegame, which you were analysing, too. Debug console never opened. You can't reproduce it?

I just did load this savegame (with Odysseus2 cleaned from MechJeb) into a fresh unzipped 1.2 install without changing ANY setting and put only Memgraph into it. As soon as I load it, 30MB/s. Maybe you try it with the persistent in the pastebin.
 

Edited by Jebs_SY
Link to comment
Share on other sites

11 hours ago, Jebs_SY said:

700kb/s for a pod on the launchpad. It starts to raise to ~30MB/s when loading the Odysseus2 ship from Kerbital's savegame, which you were analysing, too. Debug console never opened. You can't reproduce it?

After downloading a totally fresh copy of KSP 1.2, only installing MemGraph 1.1.0.2 and using your save with no MJ, I can now reproduce the issue.  I've looked at it with the Unity profiler and, for some reason, with this vessel but not with the pod on the pad, the part highlighting system in KSP decides to recreate a 0.8 MB cache bitmap on every frame...

I'll investigate some more and report it.  I'd like to know why my other installs don't do it, perhaps I changed the highlighting settings...

Edit: my other installs have antialiasing turned off, this totally removes the effect...

uAYBKMn.jpg

The reported allocation rate peaks around 750 KB/s just before each GC (due to the way that the display in MemGraph works this is the closest to the real rate) and the collections are over a minute apart...

Edited by Padishar
Link to comment
Share on other sites

7 minutes ago, Jebs_SY said:

@Padishar

IIRC Anti Aliasing is needed for (something for) the highlighting system. So this makes sense. Should this be reported to squad then? Do you carry the information on to them, if yes? Thx for your effort.

Well, the highlighting sort-of works with AA turned off though some parts don't seem to highlight and the highlighting also seems to get occluded by some parts.  I've already mentioned it to some Squad folks in IRC and, as soon as they tell me where best to report it properly, I will do...

Link to comment
Share on other sites

So I reinstalled the game, deleted all saves and ships. I only changed the resolution, enabled Advanced Twekables and customized keys, no other changes to the settings. I played vanilla for about 30 minutes, hiccups were extremely rare, every few minutes maybe, I didn't time them, they were really far apart, smooth experience overall. Then I installed MechJeb #644 (from a clean zip download) and everything was fine for about an hour then it started creeping in. At first, it was something like maybe every 30-40 seconds. After couple of hours of gameplay I see stutter under every 20 seconds now. I'm not anywhere near 3-5 seconds yet as before, but the stutter is noticeably creeping in.

I know this is not conclusive, I should have run vanilla game for several hours before adding MechJeb, but I really can't play the game without Mechjeb's help. So it may or may not be MechJeb's fault.

Padishar, I'll change the padding today as you suggested.

I never changed the part highlighting setting, didn't even know it was there. I'll try to run without that.

Oh, and sorry, I forgot to remove the MechJeb modules from the saves :(

Edited by Kerbital
Link to comment
Share on other sites

13 minutes ago, Kerbital said:

So it may or may not be MechJeb's fault.

Well, MechJeb is responsible for some of the garbage but the bulk of it with your vessel can be eliminated by turning off AA.  I suspect that one of the parts on the vessel is triggering the issue with the highlighter.  I'll have a go at working out which this afternoon if nobody else does first.

Link to comment
Share on other sites

34 minutes ago, Kerbital said:

I will try to turn AA off then. Although last night I was playing with small ships when stutter started to creep in. 

There are nearly as many potential causes of GC stutter as there are stars in the sky.  This particular one that stops when you turn off AA actually appears to be part-count dependent.  I put one of your vessels on the pad and got the same result, then I put just half of it on the pad and still got a lot of garbage but much less.  I then put various different chunks of the vessel on the pad and got various other smaller rates of garbage.  I then did the same thing with a couple of stock vessels and a few of my own and the problem seems pretty universal.

I'll be writing up what I've discovered so far in a bug report later this evening and also reporting another bug that I've stumbled over while testing this.  Can you confirm you don't mind your save (and name?) being attached to a Squad bug report?

Link to comment
Share on other sites

I turned off AA and parts highlighting in flight and so far no stutter to speak of. Every minute at worst. Crossing fingers!

I tried to compensate for lack of AA by using Nvidia DSR but KSP doesn't allow me to switch to any DSR resolution.  Man, I really wish games weren't so buggy these days :(

Thanks for all the help!

Link to comment
Share on other sites

On 10/28/2016 at 6:53 PM, Padishar said:

Well, the highlighting sort-of works with AA turned off though some parts don't seem to highlight and the highlighting also seems to get occluded by some parts.  I've already mentioned it to some Squad folks in IRC and, as soon as they tell me where best to report it properly, I will do...

Hi, could you point which option that I should disable to reduce every 5 secs ingame stutter? I'm having exactly same issue, stock KSP 1.2

4SfRhGS.png

Thanks

Link to comment
Share on other sites

3 hours ago, iSilver said:

Hi, could you point which option that I should disable to reduce every 5 secs ingame stutter? I'm having exactly same issue, stock KSP 1.2

I've only tried disabling the Anti-Aliasing option but I think others have said you need to turn off both of those highlighting options if you want to keep AA.

Link to comment
Share on other sites

6 minutes ago, Kobymaru said:

I really wish they would fixed that in the next minor patch. In the mean time, I'm having good success pressing Alt-End with your mod.

They did fix the highlightling/AA memory thrash in KSP 1.2.1.  Or do you mean something else by "that"?

Link to comment
Share on other sites

14 minutes ago, Kobymaru said:

Does anyone have ideas to fix this?

How much RAM have you got and how much is KSP using?  MemGraph is showing only a fairly reasonable memory allocation rate for the amount of mods you appear to have (certainly not anything like the highlightling/AA was causing in 1.2.0) but the Heap min and max are only 25 MB apart which doesn't take long to fill up.  Did you apply the padding in that screenshot and, if so, at what point in the graph and with what settings?

Link to comment
Share on other sites

8 hours ago, Padishar said:

How much RAM have you got and how much is KSP using?  MemGraph is showing only a fairly reasonable memory allocation rate for the amount of mods you appear to have (certainly not anything like the highlightling/AA was causing in 1.2.0) but the Heap min and max are only 25 MB apart which doesn't take long to fill up.  Did you apply the padding in that screenshot and, if so, at what point in the graph and with what settings?

I have 8GB system memory, don't know how much KSP was using anymore. Yes, I applied the padding in the screenshot. I tried to do it multiple times during flight, but it didn't do anything. The flight phase can be identified by the high frequency-stutter in the middle.

I restarted the game and now it seems to run fine. Maybe it was because I had the game running for a longer period and somewhere, some stuff leaked.

 

Link to comment
Share on other sites

The stutter comes and goes randomly for me. I no longer believe that it is related to AA as I was running for many hours with 4xAA and the stutter was very sporadic. I think the Highlight FX or one of the other settings, or something other altogether is the culprit.

For instance, this was with no AA and a tiny ship:

89as76r8fa6twg4bruwy5gfo78baf.png

Then I had no stutter with much larger ships and AA on. It's totally random for me.

Link to comment
Share on other sites

5 minutes ago, Kerbital said:

The stutter comes and goes randomly for me. I no longer believe that it is related to AA as I was running for many hours with 4xAA and the stutter was very sporadic. I think the Highlight FX or one of the other settings, or something other altogether is the culprit.

For instance, this was with no AA and a tiny ship:

Then I had no stutter with much larger ships and AA on. It's totally random for me.

Well, it certainly isn't random.  In your screenshot, MemGraph is currently showing about 4MB/s of usage (on average) and the difference between the Heap Min and Heap Max values is about 40MB so it took 10s to fill it up.  If you now applied the default heap padding of 1024 MB (assuming you have the memory available) then the intervals should increase significantly.

In your example, MechJeb is causing the regular memory spikes every 5 seconds and is also generating ~1MB/s of the baseline usage.

As a substantial amount of the memory usage happens in the Update code that is called every rendered frame, your high framerate will also be making things worse.  A larger vessel that only runs at 30 fps will result in quite a lot less garbage being created.  You should see an improvement by limiting your framerate to 60 (I would estimate the usage rate would drop to about 60% with a corresponding increase in the stutter intervals).

Link to comment
Share on other sites

Hi all. I'm late to this topic and I'm very unclear, reading the thread, what (if any) parts of this problem got fixed in 1.2.1 and what I should do if I'm still experiencing the issue.

8 hours ago, Padishar said:

Well, it certainly isn't random.  In your screenshot, MemGraph is currently showing about 4MB/s of usage (on average) and the difference between the Heap Min and Heap Max values is about 40MB so it took 10s to fill it up.  If you now applied the default heap padding of 1024 MB (assuming you have the memory available) then the intervals should increase significantly.

In your example, MechJeb is causing the regular memory spikes every 5 seconds and is also generating ~1MB/s of the baseline usage.

As a substantial amount of the memory usage happens in the Update code that is called every rendered frame, your high framerate will also be making things worse.  A larger vessel that only runs at 30 fps will result in quite a lot less garbage being created.  You should see an improvement by limiting your framerate to 60 (I would estimate the usage rate would drop to about 60% with a corresponding increase in the stutter intervals).

That advice seems like a good starting point for me. Where/how do I adjust the heap padding? EDIT: Nevermind, found the link in @Padishar's signature.

Edited by Newnard
Foolish question. :)
Link to comment
Share on other sites

3 hours ago, Newnard said:

Hi all. I'm late to this topic and I'm very unclear, reading the thread, what (if any) parts of this problem got fixed in 1.2.1 and what I should do if I'm still experiencing the issue.

Just to follow up more explicitly on this part, KSP 1.2.1 fixed the severe memory thrash when both AA and part highlighting are turned on but there is still a bug in this area that causes the game to crash to desktop, e.g. if you have both turned on and then hit F12 to enable the aero overlay, the game will probably crash within a few seconds.

Link to comment
Share on other sites

  • 1 year later...
On 21.01.2015 at 7:40 AM, SessoSaidSo said:

I just tested this tonight. I built a brand new rig (I'm not rich, I just work at Tigerdirect), it was pretty low tech being an A10-7850k with 4GB of ram on a 128 Corsair GS. I loaded what is essentially a copy paste of my modded Kerbal game data file. Of course the game was quite laggy but I did not experience the massive and noticeable freezes.

The issue happens with both SSD's of all types and HDD's so I think it narrows that out. I have had the issue on win 7 home/pro and windows 8.1 home/pro. The amount of ram seems to be a non-issue. This really narrows iut down to CPU, GPU, or MOBO.

Caught this on tape! - proof of the Freeze!

I have same problem. Is there any solution?

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