Embedded Wizard Studio: Garbage Collector window

The Garbage Collector window provides a view on the stock change of all objects created dynamically during an active prototyping session. As such it is useful in order to monitor how the number of existing objects raises and declines while you test a GUI component. In other words the Garbage Collector window tracks the creation and the disposal of objects:

Garbage Collector window while prototyping an application

Dynamically created objects and the Garbage Collector

Usually, new objects are created with the operator new. However, global entities like autoobjects, bitmap and font resources are also considered as dynamically created instances. They are created automatically on demand just at the moment when they are accessed within the GUI application.

Once created the object remains alive until it is not used anymore. Embedded Wizard contains for this purpose a Garbage Collector, which takes care of the automatic detection and disposal of unused dynamically created objects. An object is considered as not used if there is absolutely no reference the application can use to access the object.

Show the Garbage Collector window

The Garbage Collector window appears automatically when the prototyping session is started. However, if you have previously hidden the window, you can show it again by using the shortcut Alt9 or the menu item WindowGarbage Collector.

Unlike other debugging windows, the Garbage Collector window is available even if the GUI application is actually not paused, so you can observe how the number of objects changes while you are interacting with the application.

Columns

The list view in the Garbage Collector window is composed of the following five columns:

Column

Description

Class

The first column displays the name of the class the objects descend from.

Before

The second column displays the number of objects existing just before the last garbage collection begun.

After

The third column displays how many objects have survived the last garbage collection. Accordingly the difference between values from the column Before and After results in the number of objects detected and disposed by the last garbage collection cycle.

Peak

The fourth column displays the maximal number of objects existing at the same time since the begin of the actual prototyping session.

Trend

The fifth column displays a trend calculated from the last 32 garbage collection cycles. The trend indicates whether the object stock grows, shrinks or remains unchanged. Red bars mean that the number of corresponding objects raises and green bars imply that the number of objects declines. The size of the bar indicates the variance.

The items within the list are sorted alphabetically according to the column with the currently highlighted caption. By clicking on the caption of another column the sorting will change:

Track changes

The Garbage Collector window detects when during the prototyping session the number of monitored objects changes and highlights automatically the affected items with green color. This color fades out with every new garbage collection cycle allowing you to simply distinguish what has changed recently:

Inspect existing objects

You can navigate in the window and inspect all existing objects descended from the class in the selected item:

To navigate in the list use the keys Up and Down.

To inspect the objects double click on the corresponding item

... or press the key ENTER while the item is selected.

The inspected objects are listed within the Chora Objects window. Trying to inspect the objects while the prototyping sessions is active will cause the session to pause first before the Chora Objects window is shown.

Force garbage collection

Due to performance aspects, the garbage collection runs in the prototyping environment approximately every 10 seconds. This differs from the real behavior in the target system, where under normal circumstances the garbage collection is triggered periodically after every screen update. If necessary, however, you can manually force the prototyping environment to run an additional garbage collection cycle:

To request a new garbage collection cycle press the key CtrlShiftF5

... or select the menu item DebugForce garbage collection.

The additional garbage collection cycle will start immediately after the next screen update. Please note, if the actual prototyping session is paused, you can't force the garbage collection because the prototyping environment is inactive during this phase.

Hide the window

The Garbage Collector window disappears automatically as soon as the prototyping session is terminated but unlike other debugging windows, it doesn't disappear when you resume a previously paused debugging session. If desired, however, you can hide this window explicitly:

To hide the window click on its close button in the top-right corner.

While the prototyping session is paused the window can also be hidden using following steps:

To hide all debugging windows while the prototyping session is paused press the key F6

... or select the menu item WindowShow hide debugger windows.

To show the debugging windows again simply repeat the above operation.