Repeating tasks creating multiple tasks?

Discussion in 'Plugin Development' started by Perdog, Mar 26, 2012.

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



    As you can see, after running my test server for only 10 minutes, the thread count has piled up pretty high, and it seems to be causing a fairly big memory leak. This seems odd to me, A Repeating task should repeat a task shouldn't it? Not create a new task every time the previous task finishes.

    Granted my test server is run from my laptop, but still, I have never had a memory problem before. After running for 10 more minutes, my GC starts working like mad, and the CPU usage starts to spike a lot, thread count has nearly doubled, and the console lag is pretty bad (Typing into the console is excruciatingly slow). And then, the inevitable, java runs out of memory.

    All of this, and I haven't even logged into the server once :/ this is just from the plugins running, and after creating a heap dump and examining it, it's quite clear that a lot of the issues are coming from the large amount of tasks.

    So, can anyone confirm that this is indeed an issue within bukkit, or is this something on my end? Is there a way to get rid of a task when it is done running? Any help is extremely appreciated, because this is a fairly large problem for me.
  2. Offline


    Seems like this deserves a bump.

    Hoping for some good info.
  3. Offline


    Huh. Ive never ran into this issue before, and im a new developer (read: im prone to mistakes) who has worked with task scheduling

    What plugins are you running?
  4. 1 of the plugins is designed wrongly
  5. Offline


    Agreed, it seems like a fairly serious issue to me
    The plugin causing this is one of mine, but I have others that use delayed task. Delayed tasks work fine, they wait, do their thing, then shut down never to be heard from again. But it seems repeating tasks don't know when to shut down.
    My plugin isn't "designed" wrong. It has nothing to do with the way I'm handling the task, because I'm doing it the exact same way I've done it in the past, and I've never had this issue before
  6. I never said it was your plugin, the error can also be in javaplugin, if you give us some code, we can check it out
  7. Offline


    Never mind, would seem they have fixed it in the latest RB. It's now actually stopping them when it should :)
Thread Status:
Not open for further replies.

Share This Page