Dragon Survival [Forge]

Dragon Survival [Forge]

685k Downloads

[Compatibility]: Performance issues that may occur when this MOD is installed at the same time as [So Many Enchantments], [Ensorcellation] and other enchantment MODs

FirDragon opened this issue · 4 comments

commented

■ Your Discord ID

Srinater#8587

■ Dragon Survival version

dragonsurvival_1.18.2-1.5.40

■ Minecraft version

1.18

■ Single game or server?

Forge Server or host

■ Do you delete old configs before writing a bug report?

I always delete configs

■ Description of incompatibility

(Translated from Google)When players in the server are running on the map, the server will frequently and randomly freeze for a long time at a certain moment or the machine crashes directly. The reason for the machine crash is insufficient memory.
When I thought it was caused by too many mod installations, I started to try to delete high-occupancy mods, and when I used the performance monitoring MOD to monitor the execution method when it was stuck, I found that the server was stuck on the [ClawToolHandler.getDragonTools(ClawToolHandler.java:118)] method for a long time up to 50 seconds.
The code at ClawToolHandler.java:118 is https://github.com/DragonSurvivalTeam/DragonSurvival/blob/fc2f04d5e2cf4e8f529b8001fbd1bafa666466ba/src/main/java/by/dragonsurvivalteam/dragonsurvival/common/handlers/magicler1java/Claw
Through stack traceback, it is found that the calling source of ClawToolHandler.getDragonTools is [com.mlib.gamemodifiers.Condition$HasEnchantment.check(Condition.java:155)] of [So Many Enchantments].
The calling source of HasEnchantment.check comes from [onLivingUpdate], which means that [ClawToolHandler.getDragonTools] will be called almost every tick.
At the same time, in addition to [So Many Enchantments], [Ensorcellation] in the server will also call [ClawToolHandler.getDragonTools] in large numbers at some point, causing the server to get stuck.
At present, this problem is solved by deleting the [MixinEnchantmentHelper] class in the source code and recompiling, and then the server runs normally =w=.

  • I can't calculate how much this affects performance, this would require testing on more machines, don't know if any other OPs have had this problem.
  • Performance monitoring MOD: https://github.com/FirDragon/performance_tuning/tree/master
  • MC cannot generate a crash file because it is a machine crash, the following file is taken from the performance monitoring MOD log.

■ To Reproduce

  1. Update the latest version [DragonSurvival] on the server.
  2. Use [So Many Enchantments] and [Ensorcellation] in the server.
  3. Start MC server.
  4. players is moving fast
  5. "Can't keep up! Is the server overloaded? Running xxx ms or xxx ticks behind" or exit code 137 OOM

■ Crash Report

ServerOverloadFrom[So Many Enchantments].txt
ServerOverloadFrom[Ensorcellation].txt

commented

Does this only happen with [So Many Enchantments] and [Ensorcellation]?

commented

Does this only happen with [So Many Enchantments] and [Ensorcellation]?

I'm not sure if more mods are affected. Gaining enchantment levels too often could theoretically cause delays.

commented

If no other users are experiencing this problem, perhaps it can be put aside here for now.

commented

I'll put it aside anyway due to the lack of a programmer, so...
Alas, the only thing I can do is to put these mods in the list of incompatible.