// Create a new, empty project
MZmineProject newProject = new MZmineProjectImpl();
// Replace the current project with the new one
ProjectManager projectManager = MZmineCore.getProjectManager();
projectManager.setCurrentProject(newProject);
// Ask the garbage collector to free the previously used memory
System.gc();
logger.info("Project closed.");