public void close() {
		synchronized (backgroundGcMonitor) {
			commit();
			opened = false;
		}

		if (gcThread != null) {
			gcThread.activate();

			try {
				gcThread.join();
			}
			catch (InterruptedException x) {}
		}

		if (isDirty()) {
			Page pg = pool.putPage(0);
			header.pack(pg.data);
			pool.flush();
			pool.modify(pg);
			header.dirty = false;
			header.pack(pg.data);
			pool.unfix(pg);
			pool.flush();
		}

		pool.close();
		// make GC easier
		pool = null;
		objectCache = null;
		classDescMap = null;
		bitmapPageAvailableSpace = null;
		dirtyPagesMap = null;
		descList = null;
	}