javax.realtime
Class Stats

java.lang.Object
  |
  +--javax.realtime.Stats

public final class Stats
extends java.lang.Object

Stats keeps track of Runtime statistics of how many objects are created, access checks done from which MemoryArea to which MemoryArea, etc. Stats.print() allows you to print out this information and must be present right before termination of any program which you want to collect these statistics from.


Field Summary
private static long accessChecks
          Count how many access checks are done in total.
static long CALL_CHECKS
          How many checks on CALL returns were there?
static long CALL_REFS
          How many CALL's returned something that pointed to the heap?
static long COLLECT_HEAP_STATS
          Should we still be collecting heap reference statistics?
private static long HEAP_TO_HEAP
          How many HeapMemory -> HeapMemory assignments?
private static long HEAP_TO_IMMORTAL
          How many HeapMemory -> ImmortalMemory assignments?
private static long HEAP_TO_SCOPE
          How many HeapMemory -> ScopedMemory assignments?
static long heapChecks
          How many checks to the heap were there?
static long heapRefs
          How many pointers to the heap were dereferenced?
private static long IMMORTAL_TO_HEAP
          How many ImmortalMemory -> HeapMemory assignments?
private static long IMMORTAL_TO_IMMORTAL
          How many ImmortalMemory -> ImmortalMemory assignments?
private static long IMMORTAL_TO_SCOPE
          How many ImmortalMemory -> ScopedMemory assignments?
static long METHOD_CHECKS
          How many checks on METHOD calls were there?
static long METHOD_REFS
          How many parameters passed into METHODs were actually pointing to the heap?
static long NATIVECALL_CHECKS
          How many checks on NATIVECALL returns were there?
static long NATIVECALL_REFS
          How many NATIVECALL's returned something that pointed to the heap?
private static long NEW_ARRAY_HEAP
          How many array objects were allocated out of HeapMemory?
private static long NEW_ARRAY_IMMORTAL
          How many array objects were allocated out of ImmortalMemory?
private static long NEW_ARRAY_SCOPE
          How many array objects were allocated out of ScopedMemory?
private static long NEW_HEAP
          How many objects were allocated out of HeapMemory?
private static long NEW_IMMORTAL
          How many objects were allocated out of ImmortalMemory?
private static long NEW_SCOPE
          How many objects were allocated out of ScopedMemory?
private static long newArrayObjects
          Count how many array objects are created.
private static long newObjects
          Count how many new objects are created.
static long READ_CHECKS
          How many checks on READ of a base pointer were there?
static long READ_REFS
          How many base pointers on READ were actually pointing to the heap?
private static long SCOPE_TO_HEAP
          How many ScopedMemory -> HeapMemory assignments?
private static long SCOPE_TO_IMMORTAL
          How many ScopedMemory -> ImmortalMemory assignments?
private static long SCOPE_TO_SCOPE
          How many ScopedMemory -> ScopedMemory assignments?
private static boolean touched
          If not, it's possible that the user did not compile with the _STATS compiler option to add Runtime statistics to the compiled output.
static long WRITE_CHECKS
          How many checks on WRITE to a location were there?
static long WRITE_REFS
          How many checks on WRITE to a location previously pointing to the heap?
 
Constructor Summary
Stats()
           
 
Method Summary
static void addCheck(javax.realtime.MemoryArea from, javax.realtime.MemoryArea to)
          Add an access check from one MemoryArea to another MemoryArea.
static void addNewArrayObject(javax.realtime.MemoryArea to)
          Add a new array object to the statistics for that MemoryArea.
static void addNewObject(javax.realtime.MemoryArea to)
          Add a new object to the statistics for that MemoryArea.
static void print()
          Print out the statistics for this program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accessChecks

private static long accessChecks
Count how many access checks are done in total.


newObjects

private static long newObjects
Count how many new objects are created.


newArrayObjects

private static long newArrayObjects
Count how many array objects are created.


HEAP_TO_HEAP

private static long HEAP_TO_HEAP
How many HeapMemory -> HeapMemory assignments?


HEAP_TO_SCOPE

private static long HEAP_TO_SCOPE
How many HeapMemory -> ScopedMemory assignments?


HEAP_TO_IMMORTAL

private static long HEAP_TO_IMMORTAL
How many HeapMemory -> ImmortalMemory assignments?


SCOPE_TO_HEAP

private static long SCOPE_TO_HEAP
How many ScopedMemory -> HeapMemory assignments?


SCOPE_TO_SCOPE

private static long SCOPE_TO_SCOPE
How many ScopedMemory -> ScopedMemory assignments?


SCOPE_TO_IMMORTAL

private static long SCOPE_TO_IMMORTAL
How many ScopedMemory -> ImmortalMemory assignments?


IMMORTAL_TO_HEAP

private static long IMMORTAL_TO_HEAP
How many ImmortalMemory -> HeapMemory assignments?


IMMORTAL_TO_SCOPE

private static long IMMORTAL_TO_SCOPE
How many ImmortalMemory -> ScopedMemory assignments?


IMMORTAL_TO_IMMORTAL

private static long IMMORTAL_TO_IMMORTAL
How many ImmortalMemory -> ImmortalMemory assignments?


NEW_HEAP

private static long NEW_HEAP
How many objects were allocated out of HeapMemory?


NEW_SCOPE

private static long NEW_SCOPE
How many objects were allocated out of ScopedMemory?


NEW_IMMORTAL

private static long NEW_IMMORTAL
How many objects were allocated out of ImmortalMemory?


NEW_ARRAY_HEAP

private static long NEW_ARRAY_HEAP
How many array objects were allocated out of HeapMemory?


NEW_ARRAY_SCOPE

private static long NEW_ARRAY_SCOPE
How many array objects were allocated out of ScopedMemory?


NEW_ARRAY_IMMORTAL

private static long NEW_ARRAY_IMMORTAL
How many array objects were allocated out of ImmortalMemory?


heapChecks

public static long heapChecks
How many checks to the heap were there?


heapRefs

public static long heapRefs
How many pointers to the heap were dereferenced?


READ_CHECKS

public static long READ_CHECKS
How many checks on READ of a base pointer were there?


READ_REFS

public static long READ_REFS
How many base pointers on READ were actually pointing to the heap?


WRITE_CHECKS

public static long WRITE_CHECKS
How many checks on WRITE to a location were there?


WRITE_REFS

public static long WRITE_REFS
How many checks on WRITE to a location previously pointing to the heap?


NATIVECALL_CHECKS

public static long NATIVECALL_CHECKS
How many checks on NATIVECALL returns were there?


NATIVECALL_REFS

public static long NATIVECALL_REFS
How many NATIVECALL's returned something that pointed to the heap?


CALL_CHECKS

public static long CALL_CHECKS
How many checks on CALL returns were there?


CALL_REFS

public static long CALL_REFS
How many CALL's returned something that pointed to the heap?


METHOD_CHECKS

public static long METHOD_CHECKS
How many checks on METHOD calls were there?


METHOD_REFS

public static long METHOD_REFS
How many parameters passed into METHODs were actually pointing to the heap?


COLLECT_HEAP_STATS

public static long COLLECT_HEAP_STATS
Should we still be collecting heap reference statistics?


touched

private static boolean touched
If not, it's possible that the user did not compile with the _STATS compiler option to add Runtime statistics to the compiled output.

Constructor Detail

Stats

public Stats()
Method Detail

addCheck

public static final void addCheck(javax.realtime.MemoryArea from,
                                  javax.realtime.MemoryArea to)
Add an access check from one MemoryArea to another MemoryArea.


addNewObject

public static final void addNewObject(javax.realtime.MemoryArea to)
Add a new object to the statistics for that MemoryArea.


addNewArrayObject

public static final void addNewArrayObject(javax.realtime.MemoryArea to)
Add a new array object to the statistics for that MemoryArea.


print

public static final void print()
Print out the statistics for this program. You must place Stats.print() at the end of your programs if you want to display the Runtime statistics of your program. You also need to compile with the _STATS option to tell the compiler to output calls to the above methods in order to collect these statistics. Note that when _STATS is on, you cannot say anything about the runtime of the program, because it takes significant time to collect information about your program.