Resource Tracking for FlightGear: Difference between revisions

Jump to navigation Jump to search
m
m (→‎Proof of concept (patch): removed leading whitespaces (which broke syntaxhighlighting))
Line 223: Line 223:


== Proof of concept (patch) ==
== Proof of concept (patch) ==
{{Note|This should probably be updated to use the [http://api-docs.freeflightsim.org/simgear/classSGTimeStamp.html SGTimeStamp] and [[Howto:Use Property Tree Objects|SGPropertyObject]] APIs respectively.}}
{{Note|The following patch [[Howto:Create new subsystems|implements a simple SGSubsystem]] by inheriting from the base class and wrapping access to <code>/proc/pid/smaps</code> (on Linux).
This should probably be updated to use the [http://api-docs.freeflightsim.org/simgear/classSGTimeStamp.html SGTimeStamp] and [[Howto:Use Property Tree Objects|SGPropertyObject]] APIs respectively.}}


Here's a first stab at a simple subsystem to monitor FlightGear memory usage on Linux at 5 second intervals, consider it a "proof of concept" prototype now, as this would need to be cleaned up and implemented for Mac/Windows respectively - on Linux it simply works such that it merely fopen()s /proc/pid/smaps and copies two metrics to the property tree:
Here's a first stab at a simple subsystem to monitor FlightGear memory usage on Linux at 5 second intervals, consider it a "proof of concept" prototype now, as this would need to be cleaned up and implemented for Mac/Windows respectively - on Linux it simply works such that it merely fopen()s /proc/pid/smaps and copies two metrics to the property tree:

Navigation menu