Open
Description
Description
Hello, we had a very interesting case that we analysed a bit: https://spark.lucko.me/imXwP7DUMQ
Analysing the Spark profiler result, you could actually see just that:
The lag was caused by cancelling one of CraftTasks, which adds a CraftTask that looks for that CraftTask in order to cancel it. This causes an iteration through all CraftTasks to search for it, which, at 1 500 000 (!), caused quite a lag.
By analysing the heapdump we found which plugin added this amount of CraftTasks:
Proposed Behaviour
My suggestion is to add a check of the number of CraftTasks (org.bukkit.craftbukkit.scheduler.CraftTask) in the CraftScheduler with the possibility to check:
- is sync or async (org.bukkit.craftbukkit.scheduler.CraftAsyncTask)
- which plugin added how many Tasks
This would certainly speed up the analysis of lags caused by such cases.
Extra Details
No response