3.2 Dynamic Actors 2

This example is contained in org.eclipse.etrice.examples.dynamicactors2.

3.2.1 Purpose

A modified version of dynamicactors1 is used to analyze eventual memory leaks of the application.

3.2.2 Details

In this modified version creation and deletion of optional actors is looped. Each loop consists of 4 steps:

  1. create an instance of Optional2
  2. destroy the instance
  3. create an instance of Optional1
  4. destroy the instance

All together 600 steps are performed which corresponds to 300 creations and deletions.

The free memory is printed to the console. Also the overall execution time is measured. After the loop is finished the heap is analyzed using JConsole (which is a part of the Java6 distribution) to dump the heap and org.eclipse.mat to analyze it.

The measured total execution time on a Intel Core 2 Duo at 2.66 GHz was 110 ms. This corresponds to about 370 μs.

The result of the heap analysis for org.eclipse.etrice.* objects is listed in figure 3.2. The small numbers per object and the retained heap size indicate that the application has no memory leak.


PIC

Figure 3.2: Heap analysis after 600 steps

3.2.3 Noteworthy