private void cleanupStaleRequests(boolean cleanupAll) {
		synchronized (blockStreamMap) {
			List<Long> staleStreamIds = new ArrayList<>();
			for (BlockStreamRegistration registration : blockStreamMap.values()) {
				long age = System.currentTimeMillis() - registration.timestamp;
				if (age > MAX_AGE_MS) {
					staleStreamIds.add(registration.streamHandle.getStreamID());
					try {
						registration.blockStream.close();
					}
					catch (IOException e) {
						// ignore
					}
				}
			}
			for (long id : staleStreamIds) {
				blockStreamMap.remove(id);
			}
		}
	}
Cleanup unused block stream registrations which are too old
@param cleanupAll if true all requests will be cleaned-up due to server shutdown
Ghidra/Features/GhidraServer/src/main/java/ghidra/server/stream/BlockStreamServer.java