LuckPerms

LuckPerms

41.4k Downloads

Memory leak LuckPerms Sponge 4.2.7

eliskvitka opened this issue ยท 2 comments

commented

2018-05-16_23-37-04
https://paste.mc4ep.ru/orifuribev.rb

SpongeForge: 1.12.2-2655-7.1.0-BETA-3074

commented

Entries in that cache are removed when the corresponding subject is garbage collected.

https://github.com/lucko/LuckPerms/blob/45e2b7b12f57148471272c0a1d60091b5872d444/common/src/main/java/me/lucko/luckperms/common/contexts/AbstractContextManager.java#L68

Means that something else is preventing subject instances from being GCed. You need to check the incoming references to the subjects in the table.

I've made a modification above to only load the instances lazily for each subject, instead of at construction.

commented

Also just occurred to me that instances of Subject aren't being reused, which probably isn't helping. The cache for contexts is using reference equality.

Should be fixed by ^^, not much else I can do, but I think those two changes will resolve the issue for the most part. :)