Metallurgy 4: Reforged

Metallurgy 4: Reforged

438k Downloads

Memory leak in onSwordTick()

LemADEC opened this issue ยท 2 comments

commented

Describe the bug
As of 0.2.2, a memory leak is observed in onSwordTick() as it creates 4 ItemStacks per player and per tick.
Consider caching those ItemStacks to save resources.

Also, the event is called twice, once during PreTick, another during PostTick.
Consider filtering to only process the Pre or Post, not both.

Versions:

  • Metallurgy 4: Reforged: Reforged: 0.2.2
  • Forge: 14.23.5.2838
  • Minecraft: 1.12.2
  • Modpack (if available): n/a
  • Conflicting mod (if regarding mod integration): n/a
  • Other mods you think could cause issues: n/a

Additional context
Found during a code review looking for another mod's issue.

commented

oh, thanks for pointing this out!

commented

addressed here: 78943fd