AllTheLeaks (Memory Leak Fix)

AllTheLeaks (Memory Leak Fix)

539k Downloads

[1.20.1] Leaks and Features list here

pietro-lopes opened this issue ยท 0 comments

commented

Disclaimer for devs: Do NOT implement your fixes based on my implementation, my context is limited to mixins and your mod's business logic affinity.

Leaks

  • minecraft
    • 1.20.1
      • Clears Ender Dragon entity from model after usage (disabled when modernfix is loaded)
      • Prevents putting entity on ItemStack.EMPTY, clear entities on crosshair/hitresult level update
      • Adds a check of last damage to clear removed entities from it
      • Clears temporary entity tick list after done looping
  • cyclopscore
    • [1.19.1,)
      • Updates DelegatingDynamicItemAndBlockModel#world on client level update
  • blue_skies
    • [1.3.31,)
      • Clears ClientPacketListener#blue_skies$lastRidden mixin field and updates SkiesClientEvents#dungeonAmbientSoundHandler on server stopped/client player clone
  • mousetweaks
    • [2.25.1,)
      • Clears Main#openScreen/handler/oldSelectedSlot on client player clone
  • ae2wtlib
    • [15.2.3,)
      • Clears client cloned player from CraftingTerminalHandler#players
      • Clears server cloned players from CraftingTerminalHandler#players
  • toolbelt
    • [1.20.0,)
      • Use reviveCaps instead of revive and adds invalidateCaps at BeltExtensionSlot.EventHandlers#playerClone
  • ftblibrary
    • [2001.2.2,)
      • Clears BLANK_GUI#prevScreen on level unload
  • tfcthermaldeposits
    • [1.3.2,)
      • Clears TDForgeEventHandler#worldLevel on server stop
  • geckolib
    • [4.4.8,)
      • Uses WeakReferences to prevent memory leaks on GeoModel#applyMolangQueries()
  • aether
    • [1.20.1-1.4.2,)
      • Reworked DroppedItemCapability to not leak entities
  • jei
    • [15.4,15.5)
      • Clears RecipesGui#recipeTransferButtons on client player update
    • [15.8.2.24,)
      • Updates RecipeTransferButton#player and RecipeTransferButton#parentContainer on client player clone using RecipeTransferButton#update()
  • forbidden_arcanus
    • [1.20.1-2.2.0-beta1,)
      • Adds an invalidateCaps that was missing on PlayerEvents#onPlayerClone
  • easy_villagers
    • [1.20.1-1.1.4,)
      • Clears ItemTileEntityCache#CACHE and VillagerItem#cachedVillagers cache on client level update
  • flywheel
    • [0.6.9-4,)
      • Prevents old world to be added to the world list via WorldAttached#put()
  • curios
    • [5.9.1,)
      • Use reviveCaps instead of revive and invalidate on CuriosEventHandler#playerClone
  • create
    • [0.5.1.c,)
      • Clears last damage on clone from ExtendoGripItem#lastActiveDamageSource
  • journeymap
    • [5.9.21,)
      • Clears EntityDistanceComparator#player and EntityDTODistanceComparator#player after usage
  • citadel
    • [2.5.4,)
      • Clears server from CitadelServerData#dataMap on stop
  • travelersbackpack
    • [9.1.0,)
      • Use reviveCaps instead of revive and adds invalidateCaps at ForgeEventHandler#playerClone
  • irons_spellbooks
    • [1.20.1-3.4.0,)
      • Clears SpellBarOverlay#lastSelection and ClientMagicData#spellSelectionManager on client clone
      • Update SyncedSpellData#livingEntity on player clone
  • railcraft
    • [1.1.2,1.1.6]
      • Clears level from ChargeProviderImpl.DISTRIBUTION#networks on level unload
  • tombstone
    • [8.6.5,)
      • Clears LivingEntityRenderer#entity added via mixin on client level update
  • pneumaticcraft
    • [6.0.15,)
      • Clears ArmorMainScreen#upgradeOptions on client player clone
      • Unregister drones from MinecraftForge event via Entity#onRemovedFromWorld()
  • minecolonies
    • [1.20.1-1.1.647-beta,)
      • Recreates citizens and entities on level update
  • architectury
    • [9.0.8,)
      • Update NetworkManagerImpl#clientReceivables on player clone
  • ldlib
    • [1.0.25.p,)
      • Refactor a lambda that leaks level and updates ModularUI#entityPlayer on player update
  • occultism
    • [1.80.7,)
      • Adds a missing invalidateCaps at OccultismCapabilities#onPlayerClone on player clone
  • betterf3
    • [7.0.2,)
      • Reworked LocationModule#update() to prevent leak of current chunk
  • jeresources
    • [1.4.0.247,)
      • Uses Minecraft#level to create entities on MobTableBuilder#add/addSheep and updates MobTableBuilder#level on level update
  • ars_nouveau
    • [4.0.0,4.12.4]
      • Uses reviveCaps instead of revive on CapabilityRegistry.EventHandler#playerClone()
      • Rework lambda to not leak level on CasterTomeRegistry#reloadTomeData
  • smallships
    • [2.0.0-b1.4,)
      • Clears Smallships mixin variables ChunkMap#serverPlayer/list after usage
  • forge
    • [47.2,)
      • Make FakePlayers stop listening to advancements
      • Clears packet listener on server stop for FakePlayers
      • Regenerate listeners cache on server stopped
  • twilightforest
    • [4.3.2508,)
      • Clears EntityRenderer#ENTITY_MAP on level update
  • createaddition
    • [1.20.1-1.0.0b,1.20.1-1.2.3]
      • Clears level from EnergyNetworkManager#instances on level unload

Feature (config/alltheleaks.json)

  • minecraft
    • 1.20.1
      • Deduplicates VANILLA ingredients to reduce memory usage - (default: OFF)
      • Deduplicates ResourceLocations, should be tested to check if it is worth for your case - (default: OFF)
  • jei
    • [15.4.0.9,)
      • Prevents JEI from creating a search tree nodes for items that are ignored on config/jei/blacklist.cfg

        Note: This will prevent you from finding it at Creative Tab if using ModernFix search tree backed by JEI! - (default: OFF)

Fix

  • modernfix
    • [5.0.0,)
      • Replace modernfix RL deduplicate feature if needed

Metrics (Dev Only -Dalltheleaks.indev=true)

  • jei
    • [15.4.0.9,)
      • Adds metrics to see which JEI Plugins are creating more ItemStacks