Jump to content

[1.4.0] GCMonitor 1.4.8.0 - A graphic Memory monitor (Marsh 9th 2018)


sarbian

Recommended Posts

No logs => No support

I was looking into some memory usage related things for MechJeb2 and wanted a tool to display a graphic of the memory usage. So I made one.

ALT + F1 to hide/show the window

Change for 1.2

- Now include a native library to get the memory usage of the whole KSP process.

- Relative mode that graph increase and decrease of the memory

- FPS and memory counter (ALT + F to show hide). It should change color on x86 when getting near the limit

- Fixed a bug that could crash the game at random. duh.

1.2.2

- Fix OSX detection

- Fix Window requiring the debug dll

1.2.3

- AppLauncher and Blizzy Toolbar support. Right click open the window and Left click switch the memory / FPS counter

- "Top" button to set a fixed point to compare with.

- Setting saved into a file after first use.

- Icon change with the used memory. If you want to change the warning and alter limit edit the file in "GameData\GCMonitor\PluginData\GCMonitor" and change warnPercent & alertPercent

- AVC file included but not tested

1.2.4

- new method for the FPS counter

- options to move, resize and hide the FPS and Mem counter

- Config window to set the new options

1.2.5

- include dll for KSP x64 on windows

- fix the inverted FPS and Memory option

1.2.6

- On Windows uses the Virtual Memory size instead of the RSS for the KSP memory use. You will get larger numbers but they are more relevant to the 4GB limit.

1.2.7

- Fix the false alert on Linux

- hide the UI / Display on F2

Compiled Native lib included for Windows, OSX and Linux x64

The source for that lib are also in the zip for those who want to compile. A quick look at the cs source will show you how the lib need to be named. Search for the "[GCMonitor]" in the log to see if it worked.

About the Reported value when KSP process is not checked:

- this report the Managed memory space of mono. This is why it report low number like 200MB. This is only the memory used by the C# part of the game and plugins. It does not include the texture, models and those stuff.

- Mono use a garbage collector system so the sawtooth graph is normal. Memory grow until the garbage collector clean it up (it's actually a bit more complex but ... )

- The gray area is the minimum reported memory in an interval. The green one is the maximum. So it a lot of memory is used or freed in an interval you get green area

- The red line at the bottom is how many time the garbage collector ran in the interval (10px per time).

1.2.8-1.4.1

- Stuff

1.4.2

- lowered the memory usage to 84B per frame with the counters displayed and about 900B per frame with the window open. I don't think I can get it much lower.

1.4.3

- fix the counters moving with the app scale

1.4.4 

- fix a memory use related to the FPS/Memory displays that @Padishar detected a long teim ago but I could not track down before;

1.4.5

- fix the config button....

1.4.6

- Lower memory garbage with the GPU monitoring. Thanks to @Padishar

- Switch to custom code to load the asset bundle so the UI is available for the start

- an other attempt at fixing the OSX memory detection

1.4.7.x : KSP 1.2 update

1.4.7.2 : KSP 1.3 update

1.4.8.0 : KSP 1.4 update

Download : GCMonitor-1.4.8.0.zip

Source : https://github.com/sarbian/GCMonitor and https://github.com/sarbian/KSPUIHelper

License : MIT and CC0 for the native lib

And now awesome pictures, because this is how we sell plugin around here :

GCM-FPS.png

GCMonitor.png

Edited by sarbian
Link to comment
Share on other sites

- I have no idea on how to do the same thing for the memory used by texture and such. If anyone has tested way to get those info with a plugin feel free to share.

Really hope someone can help out here. It would be great to see what my biggest memory users are for textures

Link to comment
Share on other sites

As asked I added a new mode with more color. new DL in first post. Be careful because I removed the version number from the dll, so you have to delete the old one.

a graph without scale should be ignored

Come back when you have some code to write text on a Texture2D that is not longer than the whole actual plugin. Some things seems really simple but are not.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 4 weeks later...
  • 4 weeks later...
  • 1 month later...

Released 1.2 with KSP real memory usage thingy and a Kitty.

- Now include a native library to get the memory usage of the whole KSP process.

- Relative mode that graph increase and decrease of the memory

- FPS and memory counter (ALT + F to show hide). It should change color on x86 when getting near the limit

- Fixed a bug that could crash the game at random. duh.

Compiled Native lib included for windows x86 (and Linux x64 but not tested).

The source for that lib are also in the zip for those who want to compile. A quick look at the cs source will show you how the lib need to be named. Search for the "[GCMonitor]" in the log to see if it worked.

*Kitty not included in all zip

Edited by sarbian
Link to comment
Share on other sites

Released 1.2 with KSP real memory usage thingy and a Kitty.

- Now include a native library to get the memory usage of the whole KSP process.

- Relative mode that graph increase and decrease of the memory

- FPS and memory counter (ALT + F to show hide). It should change color on x86 when getting near the limit

- Fixed a bug that could crash the game at random. duh.

Compiled Native lib included for windows x86 (and Linux x64 but not tested).

The source for that lib are also in for those who want to compile. A quick look at the cs source will show you how the lib need to be named. Search for the "[GCMonitor]" in the log to see if it worked.

*Kitty not included in all zip

Waw HUGE, it makes my MemoryUsage mod useless (on which I've planned to add an update ... but now I don't know if I will keep it alive) ;)

(and GCMonitor works fine on linux x64).

Edited by Malah
grammar
Link to comment
Share on other sites

Having a problem. The KSP Memory stays at zero and never changes.

Here's the snip from the output.log


Load(Assembly): GCMonitor/GCMonitor

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)


AssemblyLoader: Loading assembly at F:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\GCMonitor\GCMonitor.dll

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)


Load(Assembly): GCMonitor/getRSS_x86

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)


AssemblyLoader: Loading assembly at F:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\GCMonitor\getRSS_x86.dll

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)


Failed to load assembly F:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\GCMonitor\getRSS_x86.dll:
System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid. at Mono.Cecil.PE.ImageReader.ReadOptionalHeaders (System.UInt16& subsystem, System.UInt16& dll_characteristics) [0x00000] in <filename unknown>:0 at Mono.Cecil.PE.ImageReader.ReadImage () [0x00000] in <filename unknown>:0 at Mono.Cecil.PE.ImageReader.ReadImageFrom (System.IO.Stream stream) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00000] in <filename unknown>:0 at AssemblyLoader.ScanForBadTypeRefs (System.String file) [0x00000] in <filename unknown>:0 at AssemblyLoader.LoadExternalAssembly (System.String file) [0x00000] in <filename unknown>:0




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