Look into reducing memory usage of FMLDeobfuscatingRemapper?
bs2609 opened this issue · 2 comments
This is just a suggestion, apologies if this is not the right place for those.
One of the things I saw to be using a reasonable amount of memory in heap dumps is the FMLDeobfuscatingRemapper
class (80-90 MB heap retained). This stores all the mapping data for deobfuscation, but the only thing that I saw using it at runtime (after loading is complete) is ObfuscationReflectionHelper
, which, on inspection, doesn't appear to do anything that ReflectionHelper
wouldn't work for (everywhere that Forge uses it passes both MCP+SRG names anyway).
I think it may be possible, after loading is finished, to reflectively empty the various collections stored by FMLDeobfuscatingRemapper
and then just redirect calls from ObfuscationReflectionHelper
to equivalent ReflectionHelper
methods. However, I'm not sure, so I'd appreciate your views on this suggestion.
I'm afraid not - Minecraft classes are not entirely loaded by the time the game is loaded, and this behaviour is generally unpredictable - what if a class gets unloaded?