KSPWheel icon indicating copy to clipboard operation
KSPWheel copied to clipboard

Excessive Mono Heap Allocation

Open friznit opened this issue 5 years ago • 3 comments

  • [x] KSP Version 1.5.1
  • [x] Tested in Vanilla (running only Foundries & KSPWheel with Mem Graph)
  • [x] Logs attached

Running mem graph shows the mono heap allocation spiking when parts from these mod load into the world and the garbage collection subsequently runs every 10 seconds or so, causing a periodic "stutter" (it's unity doing its thing). I can't see anything related in the logs, though I'm not an expert - log attached for reference. It doesn't really manifest when running the mods alone, presumably as there's sufficient overhead to cover it, but when you add in a couple of parts/graphics/life support things tank rapidly. KSP.log

friznit avatar Dec 19 '18 01:12 friznit

Have reviewed the simulation code and there doesn't appear to be any needless garbage generation there. All loops are done with numeric iterator constraints, no new objects are allocated on the heap, all references are cached were possible.

Quite possible that the issue is with the dust and sound code (more likely the dust part...). Doesn't look like I'll be able to get it cleaned up for the next release, but I will spend some time investigating the source of this issue in the near future.

One thing that might help -- you might try disabling dust-effects in the in-game KSPWheel settings; might mitigate the problem, or at least give some confirmation as to its location.

shadowmage45 avatar Jan 01 '19 19:01 shadowmage45

Turning off dust effect didn't help much.

HorusAK avatar Jan 30 '19 21:01 HorusAK

Thanks for the info. Will put that to use during my investigations (which will hopefully be sooner rather than later...).

shadowmage45 avatar Feb 01 '19 00:02 shadowmage45