| None. |
|
Writes the runtime's string and object counters to the debug log. Every call begins with the original three counter lines: Active strings :N Active objects :N Unreleased objs:N These legacy counters have process-wide scope. Active objects counts logically active Type instances; unreleased objects also includes deleted instances whose storage is retained by references. The counts describe lifetime and retention, not frame performance. Growth is a reason to investigate rather than proof of a leak. The Extended runtime appends a concise calling-context summary from the same model as MemorySnapshot. Runtime accounted bytes follow the runtime's charging rules, not process heap usage. Reusable Type pool storage can remain after active counts return to baseline. This calling-context summary is separate from the three process-wide legacy counters. The Original runtime keeps its three-line output. For named baselines, per-Type comparisons and JSON export, use the debugger's Memory tab. See the Memory reporting guide. Call RuntimeStats at the menu, after loading a level, and after returning to the menu. Repeating that cycle helps distinguish retained objects from capacity reused by the next level. The text uses the same diagnostic channel as DebugLog. In an IDE debug run, look in the debugger's Debug Log panel. A headless native runtime may write diagnostics to its console; a desktop run without a debugger may show nothing. The command does not call Print or draw text in the graphics window. See also: DebugLog, Delete, Handle, Object, Type. |
; RuntimeStats Example
; --------------------
Type Bullet
Field x#
Field y#
End Type
; Fill the world with objects and strings so the counters have
; something interesting to report
For i=1 To 200
b.Bullet=New Bullet
b\x=i
tag$="bullet "+i
Next
Print "RuntimeStats begins with these debug-log counters:"
Print " Active strings :N"
Print " Active objects :N"
Print " Unreleased objs:N"
Print ""
; The line this example is about - one snapshot with the bullets alive
RuntimeStats
; Clear the bullets and take a second snapshot, so the two entries in
; the log show the object count dropping
For b.Bullet=Each Bullet
Delete b
Next
RuntimeStats
Print "Two snapshots have been taken - one with 200 bullets alive and"
Print "one after deleting them. Reusable Type capacity can remain."
Print ""
Print "The counts go to the same place as DebugLog, which means the"
Print "Debug Log panel of the IDE's debugger. Run this from the IDE"
Print "with debugging enabled to read them. Headless native runtimes"
Print "may send diagnostic output to the console instead."
Print ""
Print "Press any key to close the example"
WaitKey
End