Presentation on theme: "SSCLI workshop, Redmond 19 September 2005 Richard Jones, Hanspeter Johner, Marion Sébastien University of Kent GCspy."— Presentation transcript:
SSCLI workshop, Redmond 19 September 2005 Richard Jones, Hanspeter Johner, Marion Sébastien University of Kent GCspy for Rotor
SSCLI workshop, Redmond 19 September GCspy Heap Visualisation Framework 1.Motivation & requirements 2.Abstractions & Architecture 3.Benefits 4.Rotor implementation 5.New views 6.Conclusion Developed by Richard Jones and Tony Printezis
SSCLI workshop, Redmond 19 September Motivation GCs have (almost) chaotic behaviour! Visualisation allows concise insight into GCs behaviour profiling / debugging Avoid collecting / analysing very large traces a picture is worth a thousand awk invocations! T.Printezis
SSCLI workshop, Redmond 19 September Abstractions Event e.g. start mark phase StreamAttribute e.g. used space TileBlock e.g. memory block SpaceComponent e.g. generation VisualiserGC
SSCLI workshop, Redmond 19 September 2005 MSR Rotor Presentation Day 6 Architecture GC/VM dependent GCspy generic Virtual Machine Application Socket Communications Event filters Used Roots Objects Cards Marked Copy DriverMS Driver Server-Interpreter Copy GCMS GC Data collectionInit Visualiser Communications Event filters Control Stream 0 Stream 1 Space 0Space 1 Client-Interpreter Space Renderer 0 Space Renderer 1 Control Stream 0 Stream 1 Stream 2
SSCLI workshop, Redmond 19 September GCspy Tile Information 8 Streams Magnifier 6 Spaces History view of the Mature M-S space Histogram view of the Mature spaces free-lists Appel-style Nursery space - separators show history View selectors Event
SSCLI workshop, Redmond 19 September 2005 CLR Profiler Available since 2003 for the.NET platform Strengths: Intended for the application developer Detailed exploration of the applications memory behaviour Different views Weaknesses: Slows down programs execution from 10 to 100 times Huge log file (can consume gigabytes of space) Needs the application to be compiled in debug mode Not portable (only for.NET on windows)
SSCLI workshop, Redmond 19 September GCspy Benefits Loosely coupled to VM rapid development of visualisation of new algorithms. Visualise a variety of data structures (card-tables, free-lists, trains…). Variety of dynamic views. Connect/disconnect to running VMs on the fly. No overhead outside data gathering periods. Designed for very large heaps. Small trace files (can store and replay).
SSCLI workshop, Redmond 19 September 2005 Rotor Server RMTk (MMTk for Rotor): What is MMTk (Memory Management Toolkit)? –Extensible and portable framework –Permits efficient and reliable build of Garbage Collectors –Originally developed for JVMs What is RMTk –Port of MMtk to Rotor by Andrew Gray –Relies on GCJ (Java compiler developed by the GCC team)
SSCLI workshop, Redmond 19 September 2005 Why RMTk? Wider range of GCs Easy and efficient implementation of new GCs Currently implemented: –Mark-Sweep –Semispace Copying –Generational Copying (copy both generations) –Generational Mark-Sweep (copy young gen, M-S old gen)
SSCLI workshop, Redmond 19 September 2005 Technical details Rotor's implementation: –Use of different GCs –Requires one build per GC Builds: –With GCspy support or not –With MMTk optimizations turned on or not –One RMTk library per collector: – Contains the GCspy drivers specific to that collector – Adds wrappers to handle communication between RMTk and GCspy –Only one GCspy server library
SSCLI workshop, Redmond 19 September MMTk's integration Application Communications Event filters Server-Interpreter Rotor Virtual Machine Copy GCMS GC Used Roots Objects Cards Marked Copy DriverMS Driver Init Data collection MMTk GC 0 MMTk GC 1 Used Roots Copy DriverMS Driver Init Objects Cards Marked GCspy abstractions allow easy replacement of data gathering mechanisms, collectors and VMs. other methods possible GCspy synchronous
SSCLI workshop, Redmond 19 September 2005 Components interaction GCSpy ServerClient RMTk mmtk mmtktransform jmtkbuild gcjmmtk RMTk library gcspyglue Rotor (Modified) SSCLI VM libgcspy.so : a is used and modified by b a b Legend: : a generates b a b : a composes b a b : a interacts with b a b
SSCLI workshop, Redmond 19 September 2005 Components instrumented A variety of different data structures have been instrumented Copy spaces (contiguous allocation) Mark-Sweep spaces Remembered sets Segregated free-lists
SSCLI workshop, Redmond 19 September 2005 GCspy client New plugin view mechanism: –Easy development and incorporation of new views –History is now just another plugin Writing a new plugin view: –Extend PluginListener (trivial 9 lines of code) –Extend PluginFrame (depends on complexity of the view) –Save as a jar file in the plugins directory Plugin manager: –Discovers available plugins –Maintains a list of activated plugins –Menu to choose the views to enable
SSCLI workshop, Redmond 19 September 2005 Benchmarks We need better benchmarks! Synthetic programs OK as stress tests Real programs for real understanding Documented Open source Existing benchmarks Zorn Krintz
SSCLI workshop, Redmond 19 September 2005 Methodology 1) RMTk without GCspy 2) RMTk + GCspy compiled in, GCspy client not connected 3) RMTk + GCspy compiled in, GCspy client connected Object-level data acquisition Performance overhead GCspy client connected: –8.47% average –36.1% worst case GCspy client disconnected: –Less than 2.5% average Caveat: –Rotor/RMTk is significantly slower than native Rotor.
SSCLI workshop, Redmond 19 September 2005 Performance
SSCLI workshop, Redmond 19 September Conclusion 1.GCspy incorporated into Rotor through RMTk. 2.Several GCs available, all instrumented for GCspy. 3.New GCspy views. 4.Good performance. 5.Documentation: Server API, GCspy client. 6.Need interesting, open source benchmarks
SSCLI workshop, Redmond 19 September 2005 Demo Play traceLaunch gcspy
SSCLI workshop, Redmond 19 September 2005 Questions?