@@ -358,29 +358,43 @@ public void CompactAll()
358358 }
359359 }
360360
361+ /// <inheritdoc />
361362 /// <summary>
362363 /// Debugdump.
363364 /// </summary>
364- public void DebugDump ( )
365+ public string DebugDump ( )
365366 {
366367 lock ( _lock )
367368 {
368- Trace . WriteLine ( "===== MemoryArena Dump =====" ) ;
369- Trace . WriteLine ( $ "Fast Lane Usage: { FastLane . UsagePercentage ( ) : P2} , Free: { FastLane . FreeSpace ( ) } bytes, Entries: { FastLane . EntryCount } , Stubs: { FastLane . StubCount ( ) } ") ;
370- Trace . WriteLine ( $ "Estimated Fragmentation: { FastLane . EstimateFragmentation ( ) } %") ;
371- Trace . WriteLine ( FastLane . DebugDump ( ) ) ;
372- Trace . WriteLine ( FastLane . DebugVisualMap ( ) ) ;
373- Trace . WriteLine ( FastLane . DebugRedirections ( ) ) ;
374-
375- Trace . WriteLine ( $ "Slow Lane Usage: { SlowLane . UsagePercentage ( ) : P2} , Free: { SlowLane . FreeSpace ( ) } bytes, Entries: { SlowLane . EntryCount } , Stubs: { SlowLane . StubCount ( ) } ") ;
376- Trace . WriteLine ( $ "Estimated Fragmentation: { SlowLane . EstimateFragmentation ( ) } %") ;
377- Trace . WriteLine ( SlowLane . DebugDump ( ) ) ;
378- Trace . WriteLine ( SlowLane . DebugVisualMap ( ) ) ;
379- Trace . WriteLine ( SlowLane . DebugRedirections ( ) ) ;
380- Trace . WriteLine ( "============================" ) ;
369+ var sb = new System . Text . StringBuilder ( ) ;
370+
371+ sb . AppendLine ( "===== MemoryArena Dump =====" ) ;
372+
373+ // Hot Path Telemetry
374+ sb . AppendLine ( $ "Fast Lane Usage: { FastLane . UsagePercentage ( ) : P2} , Free: { FastLane . FreeSpace ( ) } bytes, Entries: { FastLane . EntryCount } , Stubs: { FastLane . StubCount ( ) } ") ;
375+ sb . AppendLine ( $ "Estimated Fragmentation: { FastLane . EstimateFragmentation ( ) } %") ;
376+ sb . AppendLine ( FastLane . DebugDump ( ) ) ;
377+ sb . AppendLine ( FastLane . DebugVisualMap ( ) ) ;
378+ sb . AppendLine ( FastLane . DebugRedirections ( ) ) ;
379+
380+ sb . AppendLine ( ) ; // Clean spacing break
381+
382+ // Cold Path Telemetry
383+ sb . AppendLine ( $ "Slow Lane Usage: { SlowLane . UsagePercentage ( ) : P2} , Free: { SlowLane . FreeSpace ( ) } bytes, Entries: { SlowLane . EntryCount } , Stubs: { SlowLane . StubCount ( ) } ") ;
384+ sb . AppendLine ( $ "Estimated Fragmentation: { SlowLane . EstimateFragmentation ( ) } %") ;
385+ sb . AppendLine ( SlowLane . DebugDump ( ) ) ;
386+ sb . AppendLine ( SlowLane . DebugVisualMap ( ) ) ;
387+ sb . AppendLine ( SlowLane . DebugRedirections ( ) ) ;
388+
389+ sb . AppendLine ( "============================" ) ;
390+
391+ return sb . ToString ( ) ;
381392 }
382393 }
383394
395+ /// <inheritdoc />
396+ public void LogDump ( ) => Trace . WriteLine ( DebugDump ( ) ) ;
397+
384398 // --- UNLOCKED INTERNAL PATHS ---
385399
386400 /// <summary>
0 commit comments