Padishar

[1.2.x/1.3] MemGraph 1.1.0.3 - with Stutter Reduction

Recommended Posts

Anyway for this mod to have the keys configured?

Not everyone has a numpad.  My keyboard is a 10keyless as are a lot of gaming keyboards.

Share this post


Link to post
Share on other sites
16 hours ago, Agathorn said:

Anyway for this mod to have the keys configured?

Not everyone has a numpad.  My keyboard is a 10keyless as are a lot of gaming keyboards.

There isn't at the moment (short of tweaking the source and recompiling it yourself) but I'll see what I can do.  Probably just another little config file that contains the keybindings for the time being...

Share this post


Link to post
Share on other sites
11 minutes ago, New Horizons said:

I can not see any buttons on that GUI. Where is "Mod-End" and such?

The UI deliberately doesn't have buttons because buttons in the old UI system tend to create excessive garbage.  Mod-End means the End key on the keyboard with your configured modifier key (default of Left Alt on Windows and Right Shift on Linux).

Share this post


Link to post
Share on other sites
10 hours ago, New Horizons said:

Ok, that was not self explanatory. I will post a picture, when ready. tanjgrhi_jpg.htm

http://www.directupload.net/file/d/4434/tanjgrhi_jpg.htm

(sorry, uploaded a picture first time here.)

Now wonder I get a hard time playing.

http://www.directupload.net/file/d/4434/ule79d2p_jpg.htm

I would recommend something like imgur.com to upload images in future, the site you've used has a silly advert that completely obscures the image.

Yes, your game is generating quite a large amount of garbage, did you have any specific questions.  You may need to adjust the heap padding configuration (assuming you have a decent amount of memory) to get a better improvement in the stutter...

Share this post


Link to post
Share on other sites
Spoiler

 

Sorry for funny presentation

What to blame? How to solve. Or I hit  some sort of seiling? I was thought 20gb+64bit now I finaly can have all I want. Nope.

Why scansat - its just usual suspect without much reason

why Configuratior - I just noticed freezes every five seconds recently, possible after recent configurator update. I deleted all unused flights and debris but it's same, so I start to google and experiment. But on it's own configurator seems not create much problems. 

why there - well, you understand this things

 

To be clear, I have no idea what i'm doing, I just add and remove things and load  the same quick save and things changes. 

 

Edited by Pol

Share this post


Link to post
Share on other sites
14 hours ago, Padishar said:

... Yes, your game is generating quite a large amount of garbage, did you have any specific questions.  ...

My save is from KSP 1.1.2 and I have to admit playing a highly modded game of RSS (scaled down to 0.57 with the help of Sigma Dimensions), RO and RP-0 (in parts) with Real Fuels Stock Size - plus many mods are using up 7-9 GB from 16 GB total on Win7.

As a next step I want to know where KSP stores its log files - to learn more about my mixture. Then I will will move to a new Save-File, which I want to edit, so that I can keep my progress in game (already finished unmanned exploration of Venus and Mars and beeing on the verge of Apollo-Programm [using "Contract Pack: Historic Missions" - maybe loaded to many missions in Contract Configurator]).

Switching to a clean save without all that finished early tech missions, carefully deleting obsolete RP-0 missions and deleting one or the other mod should give me a smooth start into the Apollo era. :-)

 

By the way: How can I see, that MOD+END does something - I am missing some kind of a feedback, same for MOD+DIVIDE.

Edited by New Horizons

Share this post


Link to post
Share on other sites

Any way to tell what assemblies are creating lots of garbage aside from loading them one at a time?

I'm sitting in space center mode and i'm getting north of 80-100MB of GC every 9 sec or so. 

 

Also - is there a guide on how best to properly (not these silly things about not using List<> at all) handle Unity GC? In particular how to optimize IMGUI and strings. I have created some Memoization extension functions, and made heavy use of object caches, but what I am particularly interested in is the IMGUI. I have no desire to have to learn a whole IDE just to make simple UIs...

I've read through this series as a starting point.

Edited by westamastaflash

Share this post


Link to post
Share on other sites

Another, more strange experiment

Spoiler

 

Maybe I get it wrong and something else is going on or unvolved but seems like I can have all mods(~50s with increased padding) but I can't have contracts

 

Spoiler

 

 

Edited by Pol

Share this post


Link to post
Share on other sites
On 03/08/2016 at 9:58 AM, Pol said:

Maybe I get it wrong and something else is going on or unvolved but seems like I can have all mods(~50s with increased padding) but I can't have contracts

Hmm thats very strange, because i could reproduce this too. Contracts are increasing the GC run from every 30 secs to every 8 secs, I have to find out if this happens only to the extra contracts where CC is needed or if this also happens with the stock contracts

Share this post


Link to post
Share on other sites

holy Kerbal kraken.. this mod is technically the most important mod which I ever have seen for KSP. Thanks for the great improvement of my personal gaming experience! 

I have played a little bit with the settings, my game is , I would not say mod heavy but also not a lightweight installation (~ 10000 patches applied)

I have a i7 3700CPU and 16 GB RAM, Win7. Two days ago GC hits every 7-8 seconds, then I stumbled about this thread. so i wan't to give a little back from my experiences:

for a 16 GB RAM machine this is a little bit overdosed:

8		: 30082000
16		: 22428000
24		: 17978000
32		: 14952000
40		: 12816000
48		: 11214000
64		: 8900000
80		: 7298000
96		: 6230000
112		: 5518000
144		: 4272000
176		: 3560000
208		: 3026000
240		: 2670000
296		: 2136000
352		: 1780000
432		: 1424000
664		: 0
800		: 0
1008	: 0
1344	: 0
2032	: 0

GC runs every ~190 sec which is more then once in 3 minutes, which is realy great, unfortunately machine has started paging because it ran out of RAM

Then i just have decreased the values about 25% 

8		: 22561500
16		: 16821000
24		: 13483500
32		: 11214000
40		: 9612000
48		: 8410500
64		: 6675000
80		: 5473500
96		: 4672500
112		: 4138500
144		: 3204000
176		: 2670000
208		: 2269500
240		: 2002500
296		: 1602000
352		: 1335000
432		: 1068000
664		: 0
800		: 0
1008	: 0
1344	: 0
2032	: 0

and the GC collector hits every 136 secs, which is more then 11 times better then before! :D this is awesome!

Conclusion: 

1.) Where is the donate button? I really want to invite you for one or two beer! Thanks man!

2.) I need more RAM! RAM is like piston capacity... can only be exchanged thru more piston capacity ! :confused: 

 

 

Share this post


Link to post
Share on other sites

It seems Memgraph was able to inadvertently help reveal a problem in one of my new memory modules (or possibly one of my RAM slots).  Interesting side effect of this cool little program.

Short Story:  Was getting 214 errors in the VAB when memory spikes happened.  This resulted in BSOD.  Nothing else could trigger this crash (as none of my others games utilize much RAM at all)  Thought it was a cooling issue that I fixed but they persisted.  After removing the new modules no more BSODs.  Memtest failed to find any errors, same with Windows mem checker.  I figure it's due to the heap I gave it forced utilization of one of the bad modules (I had 8 and upgraded to 16).  Not sure, however, but it's a good theory.  

Now it's time to find out which module went bad or if it is one of the slots.  

Edited by autumnalequinox
spelling ugh

Share this post


Link to post
Share on other sites
On 8/6/2016 at 0:37 AM, WeirdCulture said:

1.) Where is the donate button? I really want to invite you for one or two beer! Thanks man!

Glad you like it and it's working usefully for you.  I've added a donate button to the bottom of the OP...

Share this post


Link to post
Share on other sites

Ive been following this mod for a little while now and from what I gather it helps reduce that dreadful in game stutter. Im just not completely sure how one goes about using it to do this. is there a step-by-step that's easy to implement?

Share this post


Link to post
Share on other sites

Little update:  So a combination of Memgraph and errors with large (100+) file transfers helped finally identify my memory problem.  Turned out one of my ram slot pins came bent.  It dropped the RAM bandwidth when under high load, which only happened when Memgraph was working along with KSP (and the aforementioned file transfers).  No other diagnostics besides my eyeballs and a flashlight revealed this (including memtest).  

So awesome!  I moved the memory to good slots and everything is stable now.  

Share this post


Link to post
Share on other sites

Been havin stuttering problems in my new 1.1.3 game, so installed this to see what was going on. I'm -guessing- things shouldn't look like this~?

KSP MemGraph Picture

The hotkey to add to the heap doesn't seem to do much, actually seemed to be making the stutters more frequent? I don't get it.. :/

Share this post


Link to post
Share on other sites

I'm having trouble with the hotkey too. My heap Min is 2653, and max is 2680! Mod-End doesn't seem to do anything of value. KSP has 6.4 GB allocated in private bytes according to process explorer. How to get the garbage collection to space out more?

Share this post


Link to post
Share on other sites
14 hours ago, Calvin_Maclure said:

Ive been following this mod for a little while now and from what I gather it helps reduce that dreadful in game stutter. Im just not completely sure how one goes about using it to do this. is there a step-by-step that's easy to implement?

7 hours ago, DracoSilverpath said:

The hotkey to add to the heap doesn't seem to do much, actually seemed to be making the stutters more frequent? I don't get it.. :/

5 hours ago, westamastaflash said:

I'm having trouble with the hotkey too. My heap Min is 2653, and max is 2680! Mod-End doesn't seem to do anything of value. KSP has 6.4 GB allocated in private bytes according to process explorer. How to get the garbage collection to space out more?

Mod-End means to hold down the configured modifier key (on Windows this defaults to the left Alt key, on Linux it defaults to right Shift) and press the End key.  You can tell if it does something by having the debug log window open (Mod-F2), you should see some output from MemGraph indicating the padding has been applied.  Make sure you close the debug log window again as it generates a considerable amount of garbage.

You must have a reasonable amount of free physical memory when you do it or it will cause the performance to suffer because the machine will start paging stuff to and from the hard disk continuously.  If you have a large amount of free RAM then you can modify the numbers in padheap.cfg as described in various posts in this thread.

Share this post


Link to post
Share on other sites
On 8/11/2016 at 0:38 AM, Padishar said:

Mod-End means to hold down the configured modifier key (on Windows this defaults to the left Alt key, on Linux it defaults to right Shift) and press the End key.  You can tell if it does something by having the debug log window open (Mod-F2), you should see some output from MemGraph indicating the padding has been applied.  Make sure you close the debug log window again as it generates a considerable amount of garbage.

You must have a reasonable amount of free physical memory when you do it or it will cause the performance to suffer because the machine will start paging stuff to and from the hard disk continuously.  If you have a large amount of free RAM then you can modify the numbers in padheap.cfg as described in various posts in this thread.

I ended up going back and did just that! I have 32GB of ram available in total, and 6GB on my GPU, so space wasn't the issue. It was more so that the padheap wasn't set right for the higher ram amounts,a nd was seemingly hindering performanc,e or at least having no effect, by default.

Share this post


Link to post
Share on other sites

My stutter went from every 5 seconds to every 40 seconds, much more tolerable. Thanks! :D Donation inbound.

I run about 60 mods and the initial padheap numbers in the CFG didn't help. I had to increase them by a factor of 20. I have 24GB of RAM so it can handle it. What a nice impact on the stutter. When I have some free time, I may run through the mods and see what impact removing them has...if I can get the GC up to every 2-3 minutes, that would be really nice.

Edited by Starfire70

Share this post


Link to post
Share on other sites

Padishar, you mighty beast!! This mod made my KSP playable again!! I can't thank you enough.... 

I had 1s lag every 5-10 seconds and now? I can't even tell :D WOW !!

Share this post


Link to post
Share on other sites

From every 15 secondos to 105 seconds. Love you. I don't speak english but i need to say thank you, im playing kerbal again thanks to this mod.

Share this post


Link to post
Share on other sites

This is definitely helpful, for certain. I run a large amount of mods and couldn't for the life of me figure out why things seemed to be stuttering that badly. Now I know why and while it's not necessarily where I'd LIKE it to be, KSP is still more playable than it was before. This isn't necessarily an ideal fix - the IDEAL fix would be unity and/or Squad fixing their crap so that a workaround like this isn't necessary - but we all know that's never going to happen.

I do have a few questions, though. Mainly, I'm still a little lost on what Memgraph actually keeps track of, besides the obvious. Like, if I increase the scale of the graph to 64 MB, does that mean that the entire graph is from 1 to 64 MB, or is there a grid system in place and each tick is 64 mb? Also, what do the numbers up top mean. I'm assuming the "interval" metric is the period of time between the last GC operation and the one before that, but I'm having trouble making sense of the other numbers on the window.

That said, while the padded memory heap function does have a benefit, it still seems to be a bit underwhelming for me. I basically multiplied the values in the memheap.cfg file by a scalar of 8, and now I'm using approximately 70% out of my 16GB of RAM when running KSP. Yet my GC intervals seems to have only increased by a factor of 2 (from once every 10-11 seconds to once every 22-25 seconds, which is an improvement, but not what I was expecting from approximately 4-6 GB of additional memory padding) I'm guessing there are a few mods I have installed that may be generating a LOT of garbage but I'm not sure where to start looking. Does anyone have an idea which mods may be worse when it comes to adding junk to the heap? Could be either specific mods or a specific type of mod - I use very little in the way of graphics and texture mods, but I use a LOT of add-on part mods as well as functionality plugins and GUI mods. Some of my bigger ones include EPL, Near Future (everything), TAC Life Support, Strategia, TAC Fuel Balancer, Mk2 and MK3 expansion packs, TweakScale, KAS-KIS, KPBL, DeepFreeze, FRMS, and Dr. Jet's Chop Shop - to name a few!

Don't get me wrong, this trick has still helped me, but I'm not seeing dramatic changes like other people, and I'm certain at least some of my mods are to blame. One thing I should also mention is I'm exclusively playing Career Mode with a LOT of addon contracts, some of which have been creating additional flights (I have about 3 orbital rescue contracts right now, so that's 3 random parts sitting in orbit).

Anyways, even if I can't figure out a way to slim down my install, AURIGA MKIV still has two empty DIMM slots, as well as an additional spot for a storage drive. Once my new job finally starts paying, I plan on ordering another pair of 8 GB RAM sticks and an SSD and migrating my Windows install to the SSD (while still keeping the HDD for things like storing videos, etc.) Back when I first started playing KSP on my laptop, I noticed that having an SSD helped my performance much more than adding more memory, so we'll see if things improve at all running off of an SSD with 32 GB memory.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.