Enigma icon indicating copy to clipboard operation
Enigma copied to clipboard

Reduce memory usage

Open marysaka opened this issue 7 years ago • 7 comments

marysaka avatar Sep 09 '16 00:09 marysaka

Is there any way to reduce memory usage other than doing code optimization, like maybe some java arguments? I'm feeding 14GB and still can't get through to finishing decompilation for the server.

Not sure how the decompilation works, but it seems to keep everything on the memory. Any way around this like maybe skipping already decompiled files?

Thanks in advance!

PS: Using Procyon decompiler apparently used less memory, managed to finish the same decompilation using only 10GB.

MichelArendt avatar Jun 11 '21 11:06 MichelArendt

Hmm, maybe a heap dump is needed to examine what is using the memory

liach avatar Jun 28 '21 06:06 liach

I've had similar problem decompiling Minecraft client 1.17.1 along with Mojang/Microsoft's provided ProGuard deobfuscation mapping file. With default Java params I got "out of memory", same with -xmx 4GB. When this happens, you only get hint in the console. The program just look like it's continuing to crunch, my 16 threads are at approx 80%, but the progress bar no longer advance.

I upped -xmx to 16G (-xms4096M -xmx16386M) and it went through really fast without error (I have 32G).

Once this happens, I can not stop the program, ctrl-c on console does nothing, and kill does not work (have to kill -9).

This is on Ubuntu 20.04, enigma-swing-1.4.1+local-all.jar

Regards, Eric

ehoffman2 avatar Jul 10 '21 22:07 ehoffman2

Why do you want to decompile the client using Enigma? You can use the genSources task from Fabric Loom, it's less memory intensive because it does only decompilation instead of having Enigma's overhead of indexing the entire code, if you want to use it for reference while developing mods.

2xsaiko avatar Jul 10 '21 23:07 2xsaiko

Why do you want to decompile the client using Enigma? You can use the genSources task from Fabric Loom, it's less memory intensive because it does only decompilation instead of having Enigma's overhead of indexing the entire code, if you want to use it for reference while developing mods.

It's a function exposed in enigma's menu.

liach avatar Jul 11 '21 01:07 liach

Why do you want to decompile the client using Enigma? You can use the genSources task from Fabric Loom, it's less memory intensive because it does only decompilation instead of having Enigma's overhead of indexing the entire code, if you want to use it for reference while developing mods.

That tool would probably be better suited. I just used the first tool I found from a Youtube video "how to decompile minecraft". I'm kind of newbie here :-)

I traced Enigma and there doesn't seem to be any leak. Just a very high usage of hash maps, certainly from the size of Minecraft.

This was with compiling on Java 16 btw.

Regards

ehoffman2 avatar Jul 11 '21 22:07 ehoffman2

I'm giving Egnima 16GB of memory but it still thorws OutOfMemoryException

novastosha avatar Dec 05 '21 13:12 novastosha

Should be fixed as of https://github.com/FabricMC/Enigma/pull/448, I think this issue can be closed

NebelNidas avatar Sep 21 '22 20:09 NebelNidas