Listing A: MemoryBlock.java
public class MemoryBlock {
  int id;
  int size;
  byte[] block;

  public MemoryBlock( int id, int size ) {
    this.id = id;
    this.size = size;
    block = new byte[size];
    System.out.println( "MemoryBlock created: "+this );
  }

  public String toString() {
    return "{id="+id+",size="+size+"}";
  }

  protected void finalize() {
    System.out.println( "MemoryBlock finalized: "+this );
  }
}