Memory leak in BData.java
TheGreatWeegee opened this issue ยท 6 comments
Issue: Using too much memory upon startup immediately, I have 6 GBs of RAM and when the server finishes at plugin loading phase, it jumps from 2GBs to 5-6GBs being used. Ran memory dump through Eclipse Memory Analyzer, sends me to Brewery plugin.
Server software: Magma aa16688c
Minecraft version: 1.12.2
Files:
brewery__Leak_Suspects.zip
Nah, it's just that I have a lot of recipes. If something would have gone wrong, it probably would have crashed.
It looks like the BData is using a lot of Memory. My guess would be that your Brewery data files are really huge?
In 1.12 the data has to be saved to a yml file, as nbt could not be used. The yml data file gets loaded by your Server, which is really just one line of code in the Plugin: YamlConfiguration.loadConfiguration(file)
. There is no way to change this. This causes long loading times and a lot of ram usage.
As this is a Server function, your could switch to Paper, where this is much more optimized. Otherwise you would have to delete your Brewery data and with that start the plugin fresh, but this will make all Brewery Potions unusable.
In versions from 1.13 this is not an issue, as nbt is used.
Yes, they are pretty huge, although I'm a bit shocked that it consumes so much memory.
Also Magma already has Paper inside built-in, as far as I remember.
I definitely would not have chosen yml as a data storage, if i had known this back then. If the files are huge, maybe something has gone wrong with them? Is there anything unusual inside, that you can make out?