Thread: [BUG-FIX]Hyperion's Event Manager - used in PVP Planet source too

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 [BUG-FIX]Hyperion's Event Manager - used in PVP Planet source too 
    Registered Member
    .Dan's Avatar
    Join Date
    Sep 2008
    Age
    25
    Posts
    873
    Thanks given
    54
    Thanks received
    115
    Rep Power
    494
    Not everyone saw Graham's edit, so I decided to create another thread.
    Quote Originally Posted by Graham View Post
    Important notice to all Hyperion users! There is a memory leak currently present which has not been fixed in any official releases or in the Subversion repository. To fix it, open the EventManager class and after the isRunning() check, add an else which just returns from the function. If you do not fix this, your server will gradually consume more memory and CPU power and some actions may continue forever. (NOTE: this is not related to Sir Harry's memory problem - one of the first things I did was to ask him to apply this fix which did not help. According to Sir Sean, it isn't a problem with MINA either - it was something he added - which is kind of what I expected anyway since I had not experienced it during testing Hyperion and the Rune-Server official server.)
    Spoonfeed:
    In your EventManager.java search for:
    Code:
    if(event.isRunning()) {
    	event.execute();
    }
    As Graham said, all you need to do is just to add a return, so the code will be:
    Code:
    if(event.isRunning()) {
    	event.execute();
    } else {
    	return;
    }
    NOTE: Hyperion's EventManager is also used in [Only registered and activated users can see links. ].
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jun 2008
    Age
    24
    Posts
    2,313
    Thanks given
    485
    Thanks received
    231
    Rep Power
    0
    Ace, thanks
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Sep 2009
    Posts
    1,723
    Thanks given
    45
    Thanks received
    81
    Rep Power
    269
    Thanks Now i can Re add All my events back!


    Web Hosting | VPS | CDN | DDoS Protected Solutions
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Dec 2008
    Posts
    2,098
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    lol if someone needed this spoonfed to them they should learn some java
    Reply With Quote  
     

  5. #5  
    Registered Member
    .Dan's Avatar
    Join Date
    Sep 2008
    Age
    25
    Posts
    873
    Thanks given
    54
    Thanks received
    115
    Rep Power
    494
    Quote Originally Posted by Jinrake View Post
    Ace, thanks
    No problem!

    Quote Originally Posted by h4ckingURLife View Post
    Thanks Now i can Re add All my events back!
    This caused a memory leak, you didn't have to remove all of the events.

    Quote Originally Posted by Aristos View Post
    lol if someone needed this spoonfed to them they should learn some java
    Something obvious is obvious.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Nando's Avatar
    Join Date
    Feb 2009
    Age
    26
    Posts
    3,518
    Thanks given
    2,437
    Thanks received
    1,107
    Rep Power
    5000
    how much memory is this fix suppose to bring it down to?


    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Jun 2010
    Posts
    7
    Thanks given
    0
    Thanks received
    4
    Rep Power
    0
    Quote Originally Posted by Nando View Post
    how much memory is this fix suppose to bring it down to?
    Wtf? If you don't add this, every event will still be in memory after being stopped.
    Reply With Quote  
     

  8. #8  
    Tropicosaurus
    Guest
    Code:
    if(!event.isRunning()) {
        return;
    }
    event.execute();
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Jan 2010
    Posts
    336
    Thanks given
    11
    Thanks received
    4
    Rep Power
    16
    Nice fix, thanks
    Reply With Quote  
     

  10. #10  
    Registered Member
    .Dan's Avatar
    Join Date
    Sep 2008
    Age
    25
    Posts
    873
    Thanks given
    54
    Thanks received
    115
    Rep Power
    494
    Quote Originally Posted by Tropicosaurus View Post
    Code:
    if(!event.isRunning()) {
        return;
    }
    event.execute();
    Same thing.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •