KSPLeakReducer CKAN

Prevents stock KSP event callback memory leaks before they happen, complementing KSPCommunityFixes.

License: GPL-3.0

Game Version: 1.12.5

Downloads: 23

Author: appaK

Followers: 1

KSPLeakReducer

KSPLeakReducer is a small KSP 1 mod that reduces stock event callback memory leaks during scene changes, editor use, vessel unloading, and other teardown paths.

It is designed to work alongside KSPCommunityFixes. KSPCommunityFixes detects and cleans many leaks after they occur; KSPLeakReducer tries to prevent selected stock callbacks from being left behind in the first place.


What it does

  • Reduces callback leaks caused by stock KSP and Breaking Ground modules
  • Cleans up inventory callbacks during part creation, deletion, editor exit, and launch
  • Cleans callback-owning modules throughout child-part hierarchies during subtree deletion
  • Handles several teardown cases including map, tracking station, navigation, vessel, and UI
  • Runs lightweight cleanup during play and a broader cleanup during scene changes
  • Includes optional verbose logging for troubleshooting

Requirements

Recommended


Installation

Download the zip and extract it. Copy the KSPLeakReducer folder into your KSP GameData directory.

GameData/
  000_Harmony/
    0Harmony.dll
  KSPLeakReducer/
    KSPLeakReducer.cfg
    KSPLeakReducer.version
    Plugins/
      KSPLeakReducer.dll

After starting KSP, KSP.log should contain:

[KSPLeakReducer] Harmony patches applied

If you see that line, the mod loaded correctly.


Configuration

GameData/KSPLeakReducer/KSPLeakReducer.cfg contains:

KSPLEAKREDUCER
{
    VerboseDebugLogging = true
}

Set VerboseDebugLogging to false to reduce log output. Cleanup still runs normally when disabled.


Compatibility

KSPLeakReducer targets KSP 1.12.x and requires Harmony 2. It complements KSPCommunityFixes rather than replacing it — KSPLeakReducer prevents selected callbacks from being stranded, while KSPCommunityFixes handles detection and cleanup of what remains.

No gameplay or content mods are required. A small number of optional compatibility fixes are included for known mod interactions, but only activate when the relevant mod is present.

KSPLeakReducer does not attempt broad third-party leak cleanup. Its scope is stock KSP and Breaking Ground lifecycle behavior.


Troubleshooting

After starting KSP, check that KSP.log contains:

[KSPLeakReducer] Harmony patches applied

If the line is missing, confirm Harmony 2 and KSPLeakReducer are installed correctly and check the surrounding log entries for a patching exception.

Cleanup messages only appear when callbacks are actually removed, so they may not show every session:

[KSPLeakReducer] Removed N destroyed callback owners
[KSPLeakReducer] Scene-unload removed N destroyed callback owners

Verbose log entries begin with:

[KSPLeakReducer:Debug]

License

Licensed under the GNU General Public License v3.0.

Loading changelog...

Stats for KSPLeakReducer

Downloads over time

Downloads per version

New followers per day

Top Referrers

  1. spacedock.info
  2. duckduckgo.com
  3. www.google.com

Export Raw Stats

Export Downloads

Export Followers

Export Referrals

Raw stats are from the beginning of time until now. Each follower and download entry represents one hour of data. Uneventful hours are omitted.