KSP-TaxiService / CommNetConstellation

A KSP add-on that transforms the CommNet network of single type into multiple constellations of different types
GNU General Public License v3.0
8 stars 8 forks source link

Rate of garbage collection in KSP is highly increased #8

Open marsfan opened 6 years ago

marsfan commented 6 years ago

Upon installing this mod in KSP 1.4.3, the rate at which the game initiates garbage collections is highly increased, resulting in a stuttering gameplay.

Mods Installed:

Memgraph is not needed, I just used it to verify details. This glitch occurs even if memgraph is uninstalled.

Procedure:

  1. Install aforementioned mods (via either spacedock or CKAN, it happens on both) 2, Launch a save 3, Build a simple rover of any design 4, Launch onto runway.

When CNC is the only mod installed, the pause caused by garbage collection is manageable, but as the number of mods installed increased, the garbage collection happens even more frequently, and it pauses for longer. Without CNC, pauses occurred roughly every 30 seconds screenshot14 With just CNC, they occurred around every 12 seconds, and were slightly noticeable.

screenshot12

With a large number of other mods installed, the pauses were highly noticeable and occurred every 5 seconds. I do not have a screenshot of this ATM unfortunately. I understand that other mods exacerbate this issue, but removing CNC greatly decreased the rate at which this happened and for how long it paused.

Additionally, with only memgraph installed, each refresh of the graph shows a 1MB increase in current memory, while with CNC installed as well it can increase as much as 5MB each refresh. I suspect some memory leak is causing the GC to trigger more often.

KSP-TaxiService commented 6 years ago

I noticed this in my old personal session too. Somehow, my CommNet instance running worse than stock CommNet on the same data.

I plan to try to re-organise and streamline the whole network process of CNC later. This may have unacceptable implications for the CommNet-based RemoteTech 2 redevelopment if I can't maintain the performance of relatively simpler CNC.

KSP-TaxiService commented 6 years ago

@Marsfan Actually, I would like to know what you did during the mesurement of memgraph on the rover. Did you open up any CNC interface or move the rover around. Or was it simple do nothing for whole duration?

It will help to narrow down to the problematic area of CNC.

marsfan commented 6 years ago

@KSP-TaxiService I did absolutely nothing, It just happens all the time.

Some more info I remembered:

Thanks for being proactive about this.

KSP-TaxiService commented 5 years ago

This issue will be left open for further optimization rounds and discussion.

Do reach me if you have any further concern on the mod performance.

R-T-B commented 7 months ago

The performance in the recent beta builds is far worse, if I take release 1.5.7 and just add commits

https://github.com/KSP-TaxiService/CommNetConstellation/commit/e6b5d772e5980a5fb0b2e3f59e5bd38ee73d2160

https://github.com/KSP-TaxiService/CommNetConstellation/commit/098e32903b14661a6e12b09d4b4ac2af3133a977

Then I get decent performance and no nullrefs. Attatching in case someone finds it useful, no plans to maintain it unfortunately. Source is the same just cherry picked commits as mentioned,

CommNetConstellationPatched_v1.5.7.zip