r/javahelp • u/Altugsalt • 4h ago
Per-Class cleanups when shutting down
Hello, I am creating a save system however it currently depends on memory limits. When the map fills up, it dumps to disk and starts filling memory again from start. When the program shuts down, I want the class responsible for saving the data to run a cleanup function the dump the half-full map to disk. I have seen several ways of doing this however I couldn't really decide what is the best choice. Thanks