hankur / RestrictedCreative

Extremely lightweight, but fully-featured and customizable Creative mode limiter.
https://www.spigotmc.org/resources/restrictedcreative.42790/
2 stars 1 forks source link

Memory leak for massive databases #93

Closed JHarris12345 closed 3 years ago

JHarris12345 commented 3 years ago

Hey. There is a problem with the plugin loading every block into the blocksInChunk hashmap in the class me.prunt.restrictedcreative.storage.handlers.BlockHandler on startup.

My database is 1GB in size with 15 million blocks stored in it. Everytime my server runs, it goes up to max memory ridiculously fast. I ran a heap dump and took a look and here are the necessary images:

https://gyazo.com/1198434676caefa8aa035f6198a0375a https://gyazo.com/aee48e0e9bf98bfe84b2e3940d1f4b27 https://gyazo.com/144a21b597f430e7bccd561d8d96f852 https://gyazo.com/c8093e050c07201b994b5f1144ecbd4c

Is it possible the plugin is loading all the blocks in the DB into the map on plugin load instead of loading the blocks on chunk load and removing them on chunk unload? Would make the hashmap much less massive for larger servers

hankur commented 3 years ago

This Github repository is for v1 issues, and v1 isn't supported anymore.