Skip to content

The memory campaign ​

Index · Previous: The ModularUI2 port · Next: Angelica 2.x


A pack-wide sweep against memory use, across 59 mods. Individually each change is invisible; together they are why a long session no longer creeps toward the heap limit. The authors tagged their own work by kind, and this chapter keeps that split.

Memory leaks ​

Fixed well over 100 memory leaks across the pack (across 92 PRs) that caused the game world and game client to remain in RAM long after they should have been cleared. These leaks accumulated during long play sessions and pushed your memory use toward the heap limit. You'll notice longer play sessions now stay stable instead of slowly creeping upward.

Shipped in 92 pull requests

Allocations during play ​

Eliminated unnecessary object creation and chunk loading during active gameplay. Optimizations include caching repeated enum lookups, preventing fluids and mobs from triggering chunk loads, and avoiding temporary ItemStack copies while recipes are being removed at load. Most of these allocations happened every tick; a few are one-off costs during loading. The chunk-load prevention mainly buys server tick time during heavy mob and fluid activity, while the render-loop caching helps frame-time consistency.

Shipped in 31 pull requests
  • [Memory-opti:runtime allocations] use long packing to avoid allocating object wrappers in the render loop in MetaGeneratedItemRenderer (GT5-Unofficial #6066)
  • [Memory-opti:runtime allocations] cache OutputBusType#values() (GT5-Unofficial #6047)
  • [Memory-opti:runtime allocations] Fix creation of ItemStack copy during recipe removal (GT5-Unofficial #5466)
  • [Memory-opti:runtime allocations] Cache Enum.values() calls (Applied-Energistics-2-Unofficial #1109)
  • [Memory-opti:runtime allocations] Prevent flowing liquids from loading chunks (Hodgepodge #787)
  • [Memory-opti:runtime allocations] Prevent entity pathfinding from loading chunks on the server (Hodgepodge #782)
  • [Memory-opti:runtime allocations] Prevent loading chunks when ticking vanilla blocs (Hodgepodge #778)
  • [Memory-opti:runtime allocations] Fix forge config memory bomb (Hodgepodge #775)
  • [Memory-opti:runtime allocations] Prevent grass tick from loading nearby chunks (Hodgepodge #771)
  • [Memory-opti:runtime allocations] fix Witchery Enum#values() spam (Hodgepodge #767)
  • [Memory-opti:runtime allocations] Replace Enum.values() calls in forge configuration Property$Type (Hodgepodge #763)
  • [Memory-opti:runtime allocations] Fix allocations of mixins @WrapMethod in MixinModelFHC (GTNHLib #298)
  • [Memory-opti:runtime allocations] Cache frequent Enum#values() calls (EnderIO #223)
  • [Memory-opti:runtime allocations] Prevent blocks from loading chunks while ticking (Galaxy-Space-GTNH #146)
  • [Memory-opti:runtime allocations] Prevent grass tick from loading nearby chunks (Galaxy-Space-GTNH #142)
  • [Memory-opti:runtime allocations] Fix ur-ghast armor renderer spamming allocations (twilightforest #137)
  • [Memory-opti:runtime allocations] Cache frequent Enum#values() calls (Galacticraft #123)
  • [Memory-opti:runtime allocations] cache EnumOre#values() (Railcraft #114)
  • [Memory-opti:runtime allocations] Prevent loading chunks while ticking blocks (ForestryMC #110)
  • [Memory-opti:runtime allocations] Cache frequent Enum#values() calls (ForestryMC #107)
  • [Memory-opti:runtime allocations] Avoid instantiating EntityItem in the render loop (Draconic-Evolution #99)
  • [Memory-opti:runtime allocations] Cache frequent Enum#values() calls (Binnie #86)
  • [Memory-opti:runtime allocations] Reduce amount of NBTTagCompound created in TileEntityMetadata#getItemStack (Binnie #78)
  • [Memory-opti:runtime allocations] Reduce amount of NBTTagCompound created in TileEntityMetadata#getItemStack (Binnie #77)
  • [Memory-opti:runtime allocations] cache frequent enum values (nei-custom-diagram #64)
  • [Memory-opti:runtime allocations] cache frequent enum.values() calls (MagicBees #59)
  • [Memory-opti:runtime allocations] Reduce NBT Tag spam (Gadomancy #45)
  • [Memory-opti:runtime allocations] cache more IronChestType#values() (ironchest #37)
  • [Memory-opti:runtime allocations] cache IronChestType#values() (ironchest #36)
  • [Memory-opti:runtime allocations] cache DyeColor#values() (EnderCore #30)
  • [Memory-opti:runtime allocations] prevent TileMachineReservoir#update from loading chunks when looking up blocks (RemoteIO #25)

Static memory ​

Reduced startup memory overhead by 120 MB total. Changes include caching advanced model renderers to eliminate duplicates, removing unused potion ID tags, and clearing tooltip modifier caches. Loading is a little quicker too, since the duplicated models no longer have to be built.

Shipped in: GT5-Unofficial #6542, Hodgepodge #851, InGame-Info-XML #39, BuildCraft #23, ChromaticTooltipsCompat #1


Index · Previous: The ModularUI2 port · Next: Angelica 2.x

Contributors ​

Everyone who authored, reviewed or co-authored a change on this page, with how many of them:

@Alexdoru (128), @boubou19 (43), @mitchej123 (17), @DarkShadow44 (9), @UltraProdigy (8), @Kogepan229 (7), @Nikolay-Sitnikov (7), @Caedis (5), @koolkrafter5 (5), @sisyphussy (5), @glowredman (3), @MalTeeez (3), @OvermindDL1 (3), @cubefury (2), @danyadev (2), @Dream-Master (2), @lc-1337 (2), @slprime (2), @tiffit (2), @0hwx (1), @combusterf (1), @EnderProyects (1), @Glease (1), @Guvante (1), @leagris (1), @Ruling-0 (1), @serenibyss (1)