Jump to content

0x00

Members
  • Posts

    16
  • Joined

  • Last visited

Reputation

21 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Performance is generally better, but memory usage isn't drastically reduced & despite updates to garbage collection, the longer you run it, memory usage still tends to inflate, as long as the game loads pretty much every texture in memory at start i don't see how performance, specifically memory usage could be reduced. For comparison my Arma 3 installation has about 200GB of mods ontop of the 68GB game(all dlc's included) on a dedicated 500GB SSD & it hardly ever uses more than 12GB of RAM(On ULTRA), so ksp's approach to loading textures is the core reason for this problem & i don't see how any update will resolve the matter so long as how it loads textures isn't revised, our best hope i think is with ksp2,but that too uses unity,so who knows, unity is notorious for bad memory management, city skylines is another brilliant example of that fact. Cheers.
  2. Updated OP, ksp working set is now cleared only when system memory usage exceeds a specified maxium in percent,by default when 70% system memory usage is exceeded ksp's working set will be continually cleared every N seconds as defined in config,default (30), until memory usage falls below set limits, this allows KSP to remain more responsive when under the limit, as opposed to before where it was indefinitely cleared. I was actually just about to update it to function as you described,well sort of... I was testing i over the past couple of days,but you asked,so here you go...
  3. @Jognt Updated OP, Fixed Excessive System wide working set purge, only happens once when script starts as opposed to before where it occurred anytime config value was changed as well.
  4. I'll take a look into that,it might be because when the script starts or when ever you change interval it clears entire system memory pool, to increase overall available memory for KSP, I'll either find a better way to do that or may be just make it a hotkey for user to manually activate if/when a user chooses to do so. I'm not home right now, but I'll post an update when i get back in a couple of days, thanks for the feedback.
  5. @Gordon Dry I think the cause is what @Jognt suggested, your parameters, -force-glcore , I've had quite a few problems with it & so don't use it,it just crashes on me when i tried to test it so i can't exactly reproduce what you stated,so could you possibly try -force-opengl instead, OR without any parameters if that too is problematic. Cheers
  6. Cause of that error is most likely something else,an actual mod running within ksp. So perhaps attempt to run the exact modset in which you encountered this error with/without the script & let me know if in indeed the error occurs with the script but not without given the same modset. And if the error is indeed only present with the script running,please post the list of mods you're running. As others have alluded, there should be no conflict,although i don't recommend manually padding heaps(as opposed to simply having the mod running) while using the script, as they have entirely different purposes. Heap padder abstractly speaking increases ksp's memory pool to reduce garbage collection frequency,requiring more available memory, this script unallocates unused memory to windows & other applications for use when there's less available memory, GC shouldn't increase as a result of this,i.e no stuttering,only slow down incurred is during startup, scene switching(VAB to SHP & so on) and alt tabbing(if tabbed out for long period of time).
  7. Updated OP with direct download link & updated script with config to manually define frequency of memory purge to improve usability.
  8. I did make a functional writeup in C#,and tried to use TAC's plugin template to build it as a plugin,but i couldn't get VisualStudio working with KSP, but here's the C# code needed if anyone can build it,... with appropriate modifications obviously, as it's meant to run indefinitely every N seconds. using System; using System.Diagnostics; using System.Runtime.InteropServices; public class MemoryManagement { [System.Runtime.InteropServices.DllImport("kernel32.dll")] private static extern int SetProcessWorkingSetSize(IntPtr process, int minimumWorkingSetSize, int maximumWorkingSetSize); public static void Main() { System.Threading.Thread.Sleep(5000); try { GC.Collect(); GC.WaitForPendingFinalizers(); if ((Environment.OSVersion.Platform == PlatformID.Win32NT)) { SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1); Console.Beep(); System.Threading.Thread.Sleep(5000); } } catch (Exception ex) { //Console.WriteLine(ex.ToString); } } }
  9. Indeed it's not a mod & I didn't even know that was a section, although i think fewer people might find it there, so perhaps this is the best place for it in retrospect. As the functionality is a basic DllCall, if anyone can implement this as a dll that could be loaded from within ksp it would be most useful i think, and perhaps most convenient. @linuxgurugamer, ur the lord of mods, care to give it a shot, i reckon more people would use it if it were a dll plugin, it's simply a matter of clearing the working set at a fixed interval, pretty much this function https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setprocessworkingsetsize.
  10. Note really, but opengl already provides great reductions in memory usage, so it improves on opengl gains,though doesn't depend on it, you could just as well use directx11. @Gargamel Could you please move this thread to Add-On Releases.
  11. I stand corrected, I've amended my comments & done a stock test to reflect as much. I knew there were 'stock' tropes on YouTube, though challenges more than an actuall way to enjoy the game, but i never considered why anyone would want to play stock & 'NO ONE' was to strong a phrase, cheers.
  12. See updated post,and i made sure to test stock beforehand, inferior results from the outset convinced me otherwise. And besides no one plays stock,so beside excluding mods as the cause for my perceived gains/loses,i saw no reason for extended testing given the stock performance at the start screen,let alone during gameplay. License included, and It is indeed for potato machines,but it's useful nonetheless, I've got plenty of RAM,but never enough to run ARMA 3 & KSP simultaneously,with it,i can.... AND NO,testing was not under those conditions,just something i like to do occasionaly when i'm in the mood for both,shoot russians & fly kerbals. It was my mistake,by 'kerbal stuff', i was attempting to describe game play, I've clarified. I don't however know how to describe the results of memgraph,other than to say the Max Heap size is lower with, than without,not by a large margin though, and it also tends to decline after increasing in value more so with the script running,where as it remains fairly constant with out the script. License included,I didn't know third-party tools were classified as addons,hence why i posted it where i did originally.
  13. So KSP actually 'USES' very little memory, it simply 'ALLOCATES' too much, that's the infamous 'memory leak' issue, though there were numerous memory leaks,the issue most describe is simply excessive allocation,where RAM usage inflates rediculously while in game or during start, an actuall memory leak is where an application uses more & more & more RAM non-stop until an eventual crash,the AHK script below is my solution to excessive allocation,this simple script is meant to be run Persistently,thought it acts only upon KSP, KSP will have slightly less performance when alt-tabbing AND LONGER LOADING TIMES, but no performance impact otherwise while IN-GAME. Script scrubs excess memory allocation every few sec,such allocation serves a legitimate purpose, but ksp seems to abuse it, which in low RAM systems means that windows is forced to page other applications & itself,slowing down the system as well, this in effect prevents ksp from make excessive allocations while allowing windows to remain responsive as well, while making KSP 'ALLOCATE' less memory. Modset In Test(1.11GB): You'll notice, I Don't Run any clouds,got tired of the variable performance. TEST RESULTS: (NOTE: Your Results May Vary depending on available GPU memory,as opengl & directx11 tend to allocate to graphics memory over system memory) W/Out Script Running: KSP with 128Mods(1.11GB) & opengl starts up at 7GB of RAM & 8GB in VAB & >10GB during career playthrough to duna,eve & jool & back to kerbin(1hr...) W/Script Running: KSP with 128Mods(1.11GB) & opengl starts up at 3.8GB of RAM & 4GB in VAB & 5-6GB during career playthrough to duna,eve & jool & back to kerbin(1hr...) W/Out Script & W/Out Mods & Opengl: starts up at 4.9GB of RAM & 5.3GB in VAB & 5-6GB during career playthrough to duna,eve & jool & back to kerbin(accelerated time) W/ Script & W/Out Mods & Opengl: starts up at 3.5GB of RAM & 3.8GB in VAB & 4~5GB during career playthrough to duna,eve & jool & back to kerbin(accelerated time) KSP 1.7.2 including Making History & Breaking Ground, @1600*900 & Texture Quality at Half. Windows 7 Ultimate x64 Intel(R) Core(TM) i7-2630QM CPU @ 2.5GHZ x64-based PC 16384 MB NVIDIA GeForce GT 720M v22.21.13.8528 @ -2048.00 MB RAM Intel(R) HD Graphics 3000 v9.17.10.4229 @ -1988.00 MB RAM Usage: Run script,then Run KSP, you'll find memory usage should be significantly reduced & excessive allocation non-existent while script is running. I recommend placing it in the Windows StartUp folder,it only ever acts on KSP so it won't cause issues. NOTE:provided config allows setting frequency of clearing working set in seconds, Lower is more aggressive & likely to make KSP slower, higher not so much. This script pretty much offers a trade, minor performance loss(during loading/scene switching) in return for significant reductions in memory usage, it does not affect actual gameplay performance,i.e, launching & blowing up stuff... Source & Attachment are included in link below at AutoHotKey forums, post attachment includes compiled version of script in case you don't want to install AHK. Source & Compiled Executable Download ^Previous Versions No Longer Deleted & can be found by visiting the forum link below, in case you find most recent update to be faulty. Updated on 2019-08-17 Fixed excessive system wide working set purge, that only happens once on script start now to increase memory pool for ksp & no longer happens when config is updated as well. Updated on 2019-09-19 Added maxUsedMemPercent, allows ksp to remain more responsive, based on default settings, ksp working set is only cleared when system memory usage exceeds set maximum(70) percent AND every number of seconds(30) defined,also in config. Set 'maxUsedMemPercent=0', to simply clear working set every number of defined seconds irrespective of system memory usage.. AutoHotKey forums post License: MIT and BSD Software Licenses
×
×
  • Create New...