Worlds not deleting, leading to a plethora of issues including memory overuse
For a while now, my server has been suffering from an issue where each time a dungeon instance is unloaded, its not fully removed, usually this isnt a problem for my server cause a restart will wipe them away, but with more people doing dungeon activities and loading more instances, it is causing a legitimately big memory leak issue that can easily bring down large servers without warning.
[13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §dCleaning up instance 'InsightTerminus_15'... [13:19:02] [Server thread/WARN]: Nag author(s): '[MarcatoSound, Aestrus]' of 'MythicDungeons v1.2.0' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger). [13:19:02] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'InsightTerminus_15' [13:19:02] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'InsightTerminus_15' [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §d-= Unloading world InsightTerminus_15 processed in 1ms. =- [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §d-= Cleaning up InsightTerminus_15 processed in 2ms. =- [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §dCleaning up instance 'InsightTerminus_15'... [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §d-= Unloading world InsightTerminus_15 processed in 0ms. =- [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §d-= Cleaning up InsightTerminus_15 processed in 0ms. =- [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §dCleaning up instance 'InsightTerminus_15'... [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §d-= Unloading world InsightTerminus_15 processed in 0ms. =- [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §d-= Cleaning up InsightTerminus_15 processed in 0ms. =- [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §dCleaning up instance 'InsightTerminus_15'... [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §d-= Unloading world InsightTerminus_15 processed in 0ms. =- [13:19:02] [Server thread/INFO]: [MythicDungeons] [STDOUT] §d-= Cleaning up InsightTerminus_15 processed in 0ms. =- [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: org.apache.commons.io.IOExceptionList: ./InsightTerminus_15 [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:331) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1192) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at dungeonspremium.jar//net.playavalon.mythicdungeons.dungeons.Instance.lambda$dispose$2(Instance.java:500) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/java.lang.Thread.run(Thread.java:1589) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: Caused by: java.io.IOException: Cannot delete file: ./InsightTerminus_15/players [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1344) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:324) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: ... 8 more [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: Caused by: java.nio.file.NoSuchFileException: ./InsightTerminus_15/players/9ae329a1-763a-4cf3-8580-70c24ce09a72.yml [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.readAttributes(UnixFileAttributeViews.java:257) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.readAttributes(UnixFileAttributeViews.java:168) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.file.PathUtils.setReadOnly(PathUtils.java:927) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.file.DeletingPathVisitor.visitFile(DeletingPathVisitor.java:159) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.file.DeletingPathVisitor.visitFile(DeletingPathVisitor.java:37) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/java.nio.file.Files.walkFileTree(Files.java:2810) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at java.base/java.nio.file.Files.walkFileTree(Files.java:2881) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.file.PathUtils.visitFileTree(PathUtils.java:971) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.file.PathUtils.deleteDirectory(PathUtils.java:434) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.file.PathUtils.delete(PathUtils.java:391) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1341) [13:19:02] [Craft Scheduler Thread - 927 - MythicDungeons/WARN]: ... 9 more [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: org.apache.commons.io.IOExceptionList: ./InsightTerminus_15 [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:331) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1192) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at dungeonspremium.jar//net.playavalon.mythicdungeons.dungeons.Instance.lambda$dispose$2(Instance.java:500) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at java.base/java.lang.Thread.run(Thread.java:1589) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: Caused by: java.io.FileNotFoundException: File does not exist: ./InsightTerminus_15/paper-world.yml [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1349) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:324) [13:19:02] [Craft Scheduler Thread - 932 - MythicDungeons/WARN]: ... 8 more [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: org.apache.commons.io.IOExceptionList: ./InsightTerminus_15 [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:331) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1192) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at dungeonspremium.jar//net.playavalon.mythicdungeons.dungeons.Instance.lambda$dispose$2(Instance.java:500) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at java.base/java.lang.Thread.run(Thread.java:1589) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: Caused by: java.io.FileNotFoundException: File does not exist: ./InsightTerminus_15/paper-world.yml [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1349) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:324) [13:19:02] [Craft Scheduler Thread - 915 - MythicDungeons/WARN]: ... 8 more [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: org.apache.commons.io.IOExceptionList: ./InsightTerminus_15 [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:331) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1192) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at dungeonspremium.jar//net.playavalon.mythicdungeons.dungeons.Instance.lambda$dispose$2(Instance.java:500) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at java.base/java.lang.Thread.run(Thread.java:1589) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: Caused by: java.io.FileNotFoundException: File does not exist: ./InsightTerminus_15/paper-world.yml [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1349) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:324) [13:19:02] [Craft Scheduler Thread - 941 - MythicDungeons/WARN]: ... 8 more