code: public int freeMemory() {
          int size = 0;
          for (int m = 0; m < memory.length; m++) {
              size += memory[m].length;
              memory[m] = null;
          }
          memory = null;
          return size;
      }
docs: This method frees the allocated memory.
  
  @return the number of bytes which are available now