Jump to content

Slow memory leak, 3+ GB over a period of 2 hrs


Recommended Posts

So, the game works fine. It loads at around ~3GB of RAM, and in game it's 3.5 GB. Totally normal, even in 32 bit that would be the case. I'm using 64 bit, and over time of playing KSP, the memory usage slowly but surely creeps up, 4GB, 5GB, up to 6GB before I had to terminate and relaunch KSP as it would either crash the game or my system. (8GB of RAM). No idea what is causing it, I'm using SVE...

Mod list:

KSP: 1.2.2 (Win64) - Unity: 5.4.0p4 - OS: Windows 7 Service Pack 1 (6.1.7601) 64bit
Filter Extensions - 2.7.4.2
Toolbar - 1.7.13
USI Tools - 0.8.6
B9 Part Switch - 1.5.3
Bon Voyage - 0.11.1
Community Category Kit - 1.2.1
Community Resource Pack - 0.6.3
CommunityTechTree - 3.0.2
Contract Configurator - 1.21
CustomBarnKit - 1.1.10
DistantObjectEnhancement - 1.8.1
Firespitter - 7.4.2
Flexible Docking - 1.0.4
Interstellar Fuel Switch - 2.3
Kerbal Attachment System - 0.6.1
Kerbal Engineer Redux - 1.1.2.8
Kerbal Joint Reinforcement - 3.3.1
KerbNet Controller - 1.0.2
Kerbal Inventory System - 1.4
KSP-AVC Plugin - 1.1.6.2
ModularFlightIntegrator - 1.2.2
NearFutureConstruction - 0.7.2
NearFutureElectrical - 0.8.2
NearFuturePropulsion - 0.8.2
NearFutureSolar - 0.7.1
NearFutureSpacecraft - 0.5.4
Play Your Way - 1.0.1
Science Relay - 1.0.3
SSTULabs - 0.5.34.130
StageRecovery - 1.6.5
Stock Visual Enhancements - 1.1.4
Strategia - 1.5
TweakScale - 2.3.2
USI Core - 0.3.4
Karbonite - 0.8.3
Karbonite Plus - 0.7.3
Konstruction - 0.1.2
USI-LS - 0.5.13
Malemute Rover - 0.2.3
UKS - 0.50.7
KSP Interstellar Extended - 1.11.7

Here is KSP.log and output_log. (not sure how to do attachments on the forum, too used to the old vbulletin

https://www.dropbox.com/s/w6o5n03prgl0kw0/KSP.zip?dl=0

Link to comment
Share on other sites

I have RAM usage increase in a highly modded 1.2.1 KSP install (got virtual memory size to around 16 GB for just KSP in a few hours, then I generally unload/restart to avoid the worst). Nothing that serious in a stock KSP 1.2.2. install; however can still see a slight increase if I keep changing scenes (did a number of tests to be sure), even if nothing else changes. That alone brings to consider the possibility a leak may actually exist in stock (and probably many more with add-ons). Thanks to a specialized tool by @sarbian I could now check results based on number of objects dynamically used by KSP 1.2.2, and effectively seems a leak is present  related to PQ objects (procedural quadtree) used to render the planetary surface.

I'm going to report this evidence, hopefully it may help the dev team to fix at least the issue in stock. No promise....

Link to comment
Share on other sites

  • 4 weeks later...
On 17/12/2016 at 11:54 PM, diomedea said:

and effectively seems a leak is present  related to PQ objects (procedural quadtree) used to render the planetary surface.

I am a bit late to the party but you fell in the same trap than me last year :)

The game has a PQ cache that it fills up slowly until it reach a set amount (from memory 1500). Once it reach that you should find that there is no more new PQ object created (in stock).

The last time I checked I could not find a obvious leak in stock after that cache is filled. The current size of the cache is available somewhere and I think I have a bit of code to check it laying somewhere at home.

Now with mod there may be other source of leaks. From my own experience with my code (and some others) one of the common culprit is mods creating texture when they load but never destroying them. One would have to run my secretz to find out that. Maybe I should open a thread with it but I am a bit afraid of unleashing a tool that require a good knowledge of Unity to interpret its results...

Link to comment
Share on other sites

2 minutes ago, sarbian said:

I am a bit late to the party but you fell in the same trap than me last year :)

The game has a PQ cache that it fills up slowly until it reach a set amount (from memory 1500). Once it reach that you should find that there is no more new PQ object created (in stock).

The last time I checked I could not find a obvious leak in stock after that cache is filled. The current size of the cache is available somewhere and I think I have a bit of code to check it laying somewhere at home.

....

Oh, glad to learn the above :). Pity such features aren't so well documented, it takes very good modders to unveil them.

Link to comment
Share on other sites

10 minutes ago, diomedea said:

Oh, glad to learn the above :). Pity such features aren't so well documented, it takes very good modders to unveil them.

And lengthy exchange with the dev who wrote it :)

I found the counters :

PQSCache.Instance.cachePQAssignedCount
PQSCache.Instance.cachePQUnassignedCount
PQSCache.Instance.cachePQTotalCount

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