Possibly the hardest problem yet.

Discussion in 'Plugin Development' started by tom1000o, Jul 4, 2014.

?

Has anything like this ever happened to you?

  1. Yes

    100.0%
  2. No

    0 vote(s)
    0.0%
Thread Status:
Not open for further replies.
  1. Offline

    tom1000o

    EDIT: I FOUND THE PROBLEM. infinite loop. Simply needed to change a != to a >. Days were spent trying to find this error. Days!! Since I found the problem right after posting this thread, the above poll is pointless. Unless.. yes! feel free to vote in the above poll if you've ever made a silly mistake like mine!
     
  2. Offline

    Jogy34

    My best guess is that your problem lies in that you are storing the entities. This will cause major memory leaks as when that entity despawns, you'll still have an instance of it not allowing it to be cleaned up by the java garbage collector. Try storing the entity's UUID instead and modify your code accordingly to see if that fixes your problem.
     
    tom1000o likes this.
  3. Offline

    Flamedek

    tom1000o Usually when I get my server to freeze it's because of a loop. A loop that does the same thing over and over or an infinite while loop or something. Are you sure you don't have any of thoses somewhere in your code?

    Edit: -nvm second part-
     
    tom1000o likes this.
  4. Offline

    tom1000o

    Jogy34
    Flamedek1

    Thank you both for a reply. I really do appreciate it. Jogy, entity spawning is completely changed on my server, I'm able to modify the entity list with 100% accuracy. I should have said that... woops. And Flamedek1, thats exactly what it was. You were spot on my friend.

    Edit: 3+ years of coding bukkit plugins, and an error like this gets me for days. I don't know how to even process this in my mind lol
     
  5. Offline

    Flamedek

    tom1000o Few weeks of self-thought coding.. and well glad to help you out.

    Just remember this: if the server gets 'frozen' like you described, it's not realy frozen but quite the opposite. It is actually so busy with something that it just doesn't get around to processing anything else. An infinite loop is the prime example of this.
     
    tom1000o likes this.
Thread Status:
Not open for further replies.

Share This Page