private void initializeCache() throws IOException {

		if (lockCount != 0) {
			throw new IOException("Unable to re-initialize buffer cache while in-use");
		}

		if (cacheFile != null) {
			cacheFile.delete();
		}

		// Setup memory cache list
		cacheHead = new BufferNode(HEAD, -1);
		cacheTail = new BufferNode(TAIL, -1);
		cacheHead.nextCached = cacheTail;
		cacheTail.prevCached = cacheHead;

		cacheSize = 0;
		buffersOnHand = 0;

		// Create disk cache file
		cacheFile = new LocalBufferFile(bufferSize, CACHE_FILE_PREFIX, CACHE_FILE_EXT);

		cacheIndexProvider = new IndexProvider();

		// Copy file parameters into cache file
		if (sourceFile != null) {
			String[] parmNames = sourceFile.getParameterNames();
			for (String name : parmNames) {
				cacheFile.setParameter(name, sourceFile.getParameter(name));
			}
		}

		resetCacheStatistics();

		if (alwaysPreCache) {
			startPreCacheIfNeeded();
		}
	}
Construct a buffer manager for a given source file.
@param sourceFile buffer source file
@param requestedBufferSize requested buffer size.  Actual buffer size may
vary (ignored if source is not null).
@param approxCacheSize approximate size of cache in Bytes.
@param maxUndos maximum number of checkpoints retained for undo (Minimum=1).
@throws IOException if source or cache file access error occurs
Ghidra/Framework/DB/src/main/java/db/buffers/BufferMgr.java