Module

Runtime


Description

Returns information about the current state of the Runtime environment. This information can be useful for debugging purposes.

Properties

Name

Type

Read-Only

Shared

MemoryUsed

UInt64

ObjectClass

String

ObjectCount

Integer

ObjectID

Integer

ObjectRefs

Integer

Methods

Name

Parameters

Returns

Shared

IterateObjects

ObjectIterator

Property descriptions


Runtime.MemoryUsed

MemoryUsed As UInt64

Returns the total amount of memory used (in bytes) by the allocated objects.

This property is read-only.

More specifically, this returns the number of malloc’d bytes. Since the OS does not immediately give back memory after it is released there is no guarantee that this number will match OS values that you see in Activity Monitor, Task Manager or top.


Runtime.ObjectClass

ObjectClass As String

ObjectClass returns the class of the passed object.

This property is read-only.

It takes ObjectNumber as its parameter, where ObjectNumber is greater than or equal to zero and less than ObjectCount.


Runtime.ObjectCount

ObjectCount As Integer

Returns the current number of objects in existence.

This property is read-only.


Runtime.ObjectID

ObjectID As Integer

ObjectID returns a unique identifier for the passed object.

This property is read-only.

It takes index as its parameter, where index is greater than or equal to zero and less than ObjectCount.


Runtime.ObjectRefs

ObjectRefs As Integer

ObjectRefs returns the number of references to the passed object.

This property is read-only.

It Takes ObjectNumber as its parameter, where ObjectNumber is greater than or equal to zero and less than ObjectCount.

Method descriptions


Runtime.IterateObjects

IterateObjects As ObjectIterator

Iterates over the objects in the Runtime environment. Use it to get the TypeInfo for each object. See the ObjectIterator class for an example.

Sample code

The following code displays the properties related to individual objects in a multicolumn ListBox and the total amount of memory used in a TextField:

Var lastObjectIndex As Integer = Runtime.ObjectCount - 1
For i As Integer = 0 To lastObjectIndex
  Listbox1.AddRow(Runtime.ObjectID(i).ToString)
  Listbox1.CellTextAt(ListBox1.LastAddedRowIndex, 1) = Runtime.ObjectClass(i)
  Listbox1.CellTextAt(ListBox1.LastAddedRowIndex, 2) = Runtime.ObjectRefs(i).ToString
Next
TextField1.Text = Runtime.MemoryUsed.ToString

Compatibility

All projects types on all supported operating systems.

See also

ObjectIterator class; System module.