public void dispose(boolean keepRecoveryData) {

		synchronized (snapshotLock) {

			stopPreCache();

			synchronized (this) {

				if (recoveryMgr != null) {
					if (!keepRecoveryData) {
						recoveryMgr.dispose();
					}
					recoveryMgr = null;
				}
				if (sourceFile != null) {
					sourceFile.dispose();
					sourceFile = null;
				}
				if (cacheFile != null) {
					cacheFile.delete();
					cacheFile = null;
				}

				// Dispose all buffer nodes - speeds up garbage collection
				if (checkpointHeads != null) {
					for (BufferNode node : checkpointHeads) {
						while (node != null) {
							BufferNode next = node.nextInCheckpoint;
							node.buffer = null;
							node.nextCached = null;
							node.prevCached = null;
							node.nextInCheckpoint = null;
							node.prevInCheckpoint = null;
							node.nextVersion = null;
							node.prevVersion = null;
							node = next;
						}
					}
					checkpointHeads = null;
				}
				if (redoCheckpointHeads != null) {
					for (BufferNode node : redoCheckpointHeads) {
						while (node != null) {
							BufferNode next = node.nextInCheckpoint;
							node.buffer = null;
							node.nextCached = null;
							node.prevCached = null;
							node.nextInCheckpoint = null;
							node.prevInCheckpoint = null;
							node.nextVersion = null;
							node.prevVersion = null;
							node = next;
						}
					}
					redoCheckpointHeads = null;
				}
				bufferTable = null;
				currentCheckpointHead = null;
				baselineCheckpointHead = null;
				hasNonUndoableChanges = false;

				removeInstance(this);
			}
		}
	}
Dispose of all buffer manager resources including any source
buffer file.
This method should be called when this buffer manager instance
is no longer needed.
@param keepRecoveryData true if existing snapshot recovery files
should not be deleted.
Ghidra/Framework/DB/src/main/java/db/buffers/BufferMgr.java