Memory Leaks

Discussion in 'Plugin Development' started by AndrewM16921, Jan 3, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    AndrewM16921

    I've created a while suite of plugins for my personal server. Lately I've been having an issue where the memory usage on the server is hitting 100% and creating a lot of lag. I don't know if the problem is with my plugin or not, but still I could use any advice on detecting where these memory issues are and tips on preventing them in my own plugins.

    Thanks.
     
  2. Offline

    wwsean08

    theres a java program VisualVM which can tell you what your server and plugins are using for memory and stuff, you might wana look at it here, http://visualvm.java.net/
     
    desht and AndrewM16921 like this.
  3. Offline

    AndrewM16921

    Okay thanks, I'll check it out

    Holy crap, this thing is awesome. Thanks!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 22, 2016
  4. Offline

    wwsean08

    no problem, I thought you would like that, I wanted to analyze how much memory one of my plugins was using once, and after searching for about an hour i found that precious gem
     
  5. Offline

    AndrewM16921

    One question though. I monitored it on my private server, but I want to use it to monitor a remote server I run. Do you happen to know of any guides to do this?
     
  6. Offline

    wwsean08

  7. Offline

    AndrewM16921

    alrighty, thanks again :)
     
  8. Offline

    wwsean08

    not a problem, hope you are able to find the memory leak (assuming it's not just craftbukkit itself)
     
  9. Offline

    bergerkiller

    @wwsean08 Awesome, why didn't I know of this?!
    Is it possible to see exactly what memory is used where and how many? If so, this can be very useful at tracing down memory leaks in NoLagg/TrainCarts, which often happens.

    Mmh no way to trace back where the objects are...
    But seriously, why are so many SpawnerCreature.ChunkEntry objects made? In 1 second 20000 new entries were made...
     
  10. Offline

    wwsean08

    haha, yah not a clue, i'm glad that you like it though @bergerkiller
     
  11. Offline

    bergerkiller

    @wwsean08 Great thanks to you, if you hadn't posted that I would have never noticed a severe String leak in TrainCarts' Destinations class :)
    (It had 20000 String items for every destination and was growing recursively, with a 1MB save file as a result)

    It's a pretty cool app, and by generating a heap you can look at ALL references, I love this :)
    Finally possible to find out what causes the memory to increase so quickly.
     
  12. Offline

    wwsean08

    thats great @bergkiller, it's a pretty neat tool, I will give it that
     
Thread Status:
Not open for further replies.

Share This Page