EntityPlayer Memory Leak
LadyCailinBot opened this issue ยท 5 comments
WORLDGUARD-3841 - Reported by wow4201
WorldGuard Build #1708
Screenshot of memory leak
http://i.imgur.com/SLoCSH6.png
EntityPlayer is kept in memory after user logs out.
This leak doesn't occur when WorldGuard is removed.
Comment by me4502
I responded to this in IRC.
Those specific accesses expire after 2 seconds. They won't leak memory as it doesn't store them for anyone who's been offline for more than 2 seconds.
Comment by wizjany
yea - the object is only constructed here: https://github.com/sk89q/WorldGuard/blob/master/worldguard-legacy/src/main/java/com/sk89q/worldguard/session/SessionManager.java#L108
and as mentioned will expire 2 seconds later unless it's re-accessed. https://github.com/sk89q/WorldGuard/blob/master/worldguard-legacy/src/main/java/com/sk89q/worldguard/session/SessionManager.java#L59-L67
that means all the objects you have in memory have either been used in the past 2 seconds, or were released from the cache (and waiting to be GC'd already)
unless you can point out some issue in the loadingcache itself, it doesn't seem there's any leak here.
Comment by wow4201
Have you guys actually tested this with a Memory Profiler? because I'm running the latest Spigot, WorldEdit and WorldGuard. no other plugins and Same thing. In this case I'm using Windows 10, Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Comment by wizjany
I just hooked up a debugger and watched the cache object to ensure entries were expiring as expected.
I don't really see how your memory profiler is showing that there's a memory leak here either. maybe I'm missing something in your screenshot.