Malah

[0.90] MemoryUsage [v1.20 - 2015.02.19]

41 posts in this topic

If you don't want an external executable to show the memory usage of KSP, now, you can use GCMonitor

Hello, I've made a little plugin to see the real memory usage of KSP on KSP.

First of all, this plugin is a little bit more difficult to use than other mods because it need the use of an external executable to back up the amount of memory used by KSP.

This is needed because for security reasons, the functions which work with others software are blocked by KSP. I know that there is a better solution to make this (without an external executable) but this would say that I need to break the security made by Squad. I have not the skill to make this and I don't want to see a malicious mod which use what I've done. For this I've choose a simple solution: have an other executable ;)

What is it?

MemoryUsage is a plugin which adds the possibility to see the memory usage, the cpu usage and the count of threads used by KSP.

Javascript is disabled. View full album

Download:

Kerbal Stuff

Github

Licence information:

gplv3-88x31.png

GPL v3

Source code:

github

How to install it?

Unzip all files. Put the files which are in "Kerbal Space Program" folder in your game installation folder.

How to uninstall it?

Delete the MemoryUsage folder in your KSP/GameData folder and MemoryUsage.exe which is in your game installation folder.

How to use it?

To use this mod, you need to launch MemoryUsage.exe, if the game is not launched, MemoryUsage.exe will launch it. After this, in game, you just need to push on F11 to start seeing the KSP memory usage.

You can see the min/avg/max data if you hold F11 5 seconds.

If you want to launch the game in 64 bits, just put -64b in arguments: MemoryUsage.exe -64b

If you want to launch the game with opengl or anyother options just put it in arguments: MemoryUsage.exe -force-opengl

If you launch MemoryUsage.exe after KSP, you don't need an argument.

How does it work?

MemoryUsage.exe will backup the KSP memory on a file (KSP/GameData/MemoryUsage/Memory.txt) and the mod will read it, this is as easy as this.

Troubleshooting?

I have tested it only on linux 64b and windows 7 32b, I don't know if that will work on mac (I think it will not work, I need a tester).

If you are on linux and you want to launch KSP by MemoryUsage.exe you will need to launch MemoryUsage.exe with the option that you use to start KSP (ex: LC_ALL=C ...).

Changelog

v1.20 - 2015.02.19

- New: Added a min/avg/max function (with hold f11),

- New: Added a text color,

- New: Added an alarm (disabled by default, you can enable it on the file GameData/MemoryUsage/Config.txt, put Alarm to true),

- Fix: Delete the "Load" spam on the logs.

v1.11 - 2014.11.19

- Fix: Corrected the creation of memory.txt file at the startup of MemoryUsage.exe,

- Fix: Corrected the CPU usage which stop to check on Linux.

v1.10 - 2014.11.17

- New: Added the CPU usage and the threads count,

- New: Added a configfile to edit the Key to display the cpu/memory usage, you can find it at "Kerbal Space Program/GameData/MemoryUsage/PluginData/MemoryUsage/MemoryUsage.cfg",

- Fix: Corrected the KSP arguments,

- Minor fix.

v1.00 - 2014.11.07

- First release.

Thanks!

  • to willy_ineedthatapp_com for his pup_alert sound,
  • to all mods developers which make this game really huge,
  • to my friend Neimad who corrects my bad english ...
  • and to Squad for this awesome game.

Links:


If you like this tiny mod

;) you can consider a little donation...

btn_donate_LG.gif

Edited by Malah
1 person likes this

Share this post


Link to post
Share on other sites

Genius. KSP more than often crashes when I AltTab to check TaskManager. Downloading in the morning!

Edited by Chezburgar7300

Share this post


Link to post
Share on other sites

Being able to see which addon uses how much memory has been a wet dream of mine for a long time.

But since this thingis mostly external, I guess it can't do that at all :(

Share this post


Link to post
Share on other sites

How I launch MemoryUsage.exe on Linux? When I launch it, terminal appears, says "Loading..." and "Idle exit" and then closes.

Share this post


Link to post
Share on other sites
How I launch MemoryUsage.exe on Linux? When I launch it, terminal appears, says "Loading..." and "Idle exit" and then closes.

On linux you need to have mono installed.

Ubuntu: http://packages.ubuntu.com/search?keywords=mono-complete

Debian: https://packages.debian.org/stable/cli-mono/mono-complete

Arch Linux: https://www.archlinux.org/packages/extra/x86_64/mono/

(I haven't all repo for all distrib, but I think you can search with your prefer tool)

I've test it on Arch Linux with mono 3.10.

In command line you just need to write (in the directory where you have put MemoryUsage.exe) "mono MemoryUsage.exe" or "mono MemoryUsage.exe -64b" (if you want to launch KSP in 64 bits). I haven't try to launch it with wine or something like this.

By default, MemoryUsage will check if it is installed on the right folder and if KSP is launched.

If KSP isn't launched and MemoryUsage is not installed on your game folder, MemoryUsage will wait 60 seconds to see if someone launch KSP. If you don't launch KSP, it will automatically stop after the 60 seconds with this message "Idle exit".

For example, for a steam installation, you need to put MemoryUsage.exe in "~/.steam/steam/SteamApps/common/Kerbal Space Program/MemoryUsage.exe".

And, if KSP.x86 or KSP.x86_64 have been renamed, MemoryUsage can't work !

Edited by Malah

Share this post


Link to post
Share on other sites

I'm getting the following message:

MemoryUsage can't work work! You need to Restart MemoryUsage

But restarting doesn't work. I'm using Windows 7, Direct3D and many mods including Active Texture Management.

Any known fixes?

Share this post


Link to post
Share on other sites
I'm getting the following message:

But restarting doesn't work. I'm using Windows 7, Direct3D and many mods including Active Texture Management.

Any known fixes?

Did you launch the MemoryUsage.exe ?

Share this post


Link to post
Share on other sites
Did you launch the MemoryUsage.exe ?

Apparently not. I though MemoryUsage was automaticly started by the Plugin. After I start it manually, it seems to work as it should

Share this post


Link to post
Share on other sites
Apparently not. I though MemoryUsage was automaticly started by the Plugin. After I start it manually, it seems to work as it should

For security reason, KSP can't launch an external executable.

Share this post


Link to post
Share on other sites
For security reason, KSP can't launch an external executable.

Oh, I though you said it did.

if the game is not launched, MemoryUsage will launch it

It confused me into thinking the plugin started the exe automaticly

Share this post


Link to post
Share on other sites
It confused me into thinking the plugin started the exe automaticly

I've corrected it:

To use this mod, you need to launch MemoryUsage.exe, if the game is not launched, MemoryUsage.exe will launch it.

Share this post


Link to post
Share on other sites

Hello, I've made a little update ;)

Changelog

v1.10 - 2014.11.17

- New: Added the CPU usage and the threads count,

- New: Added a configfile to edit the Key to display the cpu/memory usage, you can find it at "Kerbal Space Program/GameData/MemoryUsage/PluginData/MemoryUsage/MemoryUsage.cfg",

- Fix: Corrected the KSP arguments,

- Minor fix.

Download:

Kerbal Stuff

Github

Share this post


Link to post
Share on other sites

This looks very useful! I have always wanted an easy way to monitor my CPU and RAM usage, thanks!

Share this post


Link to post
Share on other sites

Could you please add some warning system that is triggered when memory is running out (near 3.8 G). When the alarm is triggered, the Text could become red or flashing and an alarm sound should be heard.

Edited by FreeThinker

Share this post


Link to post
Share on other sites
Could you please add some warning system that is triggered when memory is running out (near 3.8 G). When the alarm is triggered, the Text could become red or flashing and an alarm sound should be heard.

This is a good idea, I will add this for a next update, thanks :) (with options to disable it ...).

Edited by Malah

Share this post


Link to post
Share on other sites

Good to hear this mod will become better,

One question. what is the difference between physical memory used by KSP and vurtual memory used by KSP?

Also, you say you basicly copy the contents of KSP memory. Beside copying, can you also modify it, let's say, free up some memory by throwing away textures ...

Share this post


Link to post
Share on other sites
One question. what is the difference between physical memory used by KSP and vurtual memory used by KSP?

The physical memory is on your ram and virtual memory is on your hard disk, the virtual memory extend your ram but it is slower.

If you need more info:

http://windows.microsoft.com/en-us/windows/what-is-virtual-memory#1TC=windows-7

https://en.wikipedia.org/wiki/Virtual_memory

Also, you say you basicly copy the contents of KSP memory. Beside copying, can you also modify it, let's say, free up some memory by throwing away textures ...

No, this mod couldn't do this, because this mode does not really interact with the memory of KSP. It just goes to read the total memory used by the software this is only a number in byte ;) If you search a mod which can make this, you can look: Loading textures only as required but it is in an experimental release!

Share this post


Link to post
Share on other sites

Hello, I've made a fix update ;)

Changelog

v1.11 - 2014.11.19

- Fix: Corrected the creation of memory.txt file at the startup of MemoryUsage.exe,

- Fix: Corrected the CPU usage which stop to check on Linux.

Download:

Kerbal Stuff

Github

Share this post


Link to post
Share on other sites
Being able to see which addon uses how much memory has been a wet dream of mine for a long time.

But since this thingis mostly external, I guess it can't do that at all :(

Don't get discouraged too easily. I plan to run some extensive testing with this nifty little utility. I'll load KSP stock-only, and record the baseline footprint. Then I'll load my first mod, record the size, and calculate the footprint difference from baseline. Then I'll uninstall that first mod, and individually install a second mod, record the size, and calculate the footprint difference from baseline. Then I'll reinstall the first mod alongside the second, record that size, and see if the resulting footprint corresponds to those two mod's footprint differences combined. If they match up, I'll consider the process proved.

Note, however, that plugin-heavy or plugin-only (mods light on parts) tend to have very "bursty" or variable memory consumption, and typically idle at levels much lower than during flight. Malah, do you have any ideas how to track this in-game?

Otherwise, thanks for a truly utility! It purports to fill a VERY longstanding need.

Share this post


Link to post
Share on other sites
Note, however, that plugin-heavy or plugin-only (mods light on parts) tend to have very "bursty" or variable memory consumption, and typically idle at levels much lower than during flight. Malah, do you have any ideas how to track this in-game?

Hello, I think that you can see it with GC functions, sarbian has made a plugin for this, but I haven't tried it: GCMonitor

1 person likes this

Share this post


Link to post
Share on other sites
Hello, I think that you can see it with GC functions, sarbian has made a plugin for this, but I haven't tried it: GCMonitor

Nice catch! Downloaded, and will install shortly.

Share this post


Link to post
Share on other sites

Hello, MemoryUsage work fine on KSP 0.90 ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now