next up previous
Next: UnsafeConversion Up: simlib Previous: MemoryAccess

MemStatistics


     NAME
	  memstatistics	- produce statistics of	exisiting Simula
	  objects in the heap

     DESCRIPTION
	  This class can be used to collect some information about
	  existing Simula  objects. It might be	useful for analyzing
	  memory utilization of	a Simula program.

     AUTHOR
	  Magnus Taube,	Lund University.

     DETAILED INTERFACE
	     MemInfoClass class	MemStatistics(MaxObjectTypes);
	     integer MaxObjectTypes; ! Largest number of
	     class/procedure/array etc types.;
	  This module collects and prints memory  statistics  of  heap
	  usage.    The	 parameter  defines  the  limit	 of  how  many
	  different object types  that	can  be	 used  for  statistics
	  collection,	also   the   number   of  lines	 printed.  The
	  information can be dumped to a  text	file  for  inspection.
	  This	class  needs more facilities in	order to be of general
	  use as a memory inspection tool.

	  Supers: MemInfoClass
	  Kind:	Instantiable
	  Init:	call Clear.
	  Sequencing: (Clear Scan Print)*

     OPERATIONS
     Clear
	     procedure Clear;
	  Reset	the module to init state. Call to get a	fresh sample.

     Scan
	     procedure Scan;
	  Collect statistics over the objects in the entier heap.

     Print
	     procedure Print(F);
	     ref(outfile) F; ! The parameter must be an	open outfile.;
	  Print	the collected statistics onto the file in  form	 of  a
	  table:

	       count:module-name/block-id    - or-
	       count:NON-BLOCK-TYPE