Shutdown server when Memory is low

Discussion in 'Archived: Plugin Requests' started by TehSkull, Aug 28, 2011.

  1. Offline

    TehSkull

    Yeah. So far so good, but I can't tell if it's working or not. I'm on a 1.8 dev build now; when I requested this plugin I was 1.7.3 recc.
     
  2. Offline

    Haloflooder

    lol, the server haven't reached 1024 because of 1.8 and lack of plugins. but we did have 25/25 players on server and still didn't reach 1024. It was 500mb yesterday now server is at 700mb.

    But it's very useful on my other server because I have 50+ plugins and some plugins like to hog/leak memory so it'll reach 4g max in 12+ hours
     
  3. Offline

    TehSkull

    @MuisYa Okay I today finally hit max RAM, with your plugin enabled, and the intended effect did not occur. I still got a heap error. Whether this is a problem with the Bukkit dev build or your plugin is yet to be determined. I'm also not certain whether I updated to your post-spell check version. Was that update for aesthetics or for functionality?
     
  4. Offline

    MuisYa

    @TehSkull MaxMemoryStop will perform the following things: Kick all players. And save the world.
    I might found out to stop a server btw. Let me check it when im home.

    Ah Btw, i made it for 1060.
    And with 1060 it works as it is advertised... I tested it, soo...

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

    McSpazzy

    @MuisYa
    I'll just leave this here.
    getServer().shutdown();
     
  6. Offline

    MuisYa

    That API is not working?
     
  7. Offline

    TehSkull

    Maybe you could decompile some of those server restarting plugins? @MuisYa @McSpazzy
     
  8. Offline

    MuisYa

    Well, thats officialy illegal.
    I tried to btw. But its only possibl using a "sender" but in this case the console is the "sender".
    I got 1 option which might work, i will make it asap.
     
  9. Offline

    McSpazzy

    @TehSkull @Haloflooder I got bored.
    RamRestart v0.1

    Stops/Restarts(if you have a restart script) server when it hits 90% ram usage. For best results, make sure you use -Xmx and -Xms when starting the server.
     
  10. Offline

    TehSkull

    @McSpazzy Whoo. Throwing it in now. :)
     
  11. Offline

    McSpazzy

    @TehSkull It will print to console every 60 seconds, telling you ram details and percent.
     
  12. Offline

    MuisYa

    @McSpazzy does youre plugin STOP the server?
     
  13. Offline

    McSpazzy

  14. Offline

    TehSkull

    @McSpazzy Your plugin also failed to work. Currently investigating the server.log
     
  15. Offline

    McSpazzy

    @TehSkull I think what is happening, is that the allocation is jumping from below 90% to over 100% in the time (60 seconds) that the plugin checks the memory levels. How much memory do you have available for the server?
     
  16. Offline

    TehSkull

    @McSpazzy 1024mb. We're stuck on 32bit for the foreseeable future.
     
  17. Offline

    McSpazzy

    @TehSkull start the server with -Xmx1024 -Xms1024

    However since your server is running with low memory, I will make some changes to the code, which should help with your problems.

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

    TehSkull

    @McSpazzy That would be much appreciated.
     
  19. Offline

    McSpazzy

    @TehSkull RamRestart

    This one does the same thing as the first one, but now it checks the memory usage whenever anyone logs on. As that is when the most common spikes in memory use occur.
     
  20. Offline

    TehSkull

    Sounds good. I just rebooted the server a minute ago, so I'll drop that in tomorrow morning.
     
  21. Offline

    TehSkull

    @McSpazzy I can confirm that the 0.1 version works now that I set our minimum and maximum RAM to be the same.
    It did it's job, and I thank you for that. I'll probably decompile it and throw in a line that alerts the players that the server's restarting and why, if that's alright with you.
     
  22. Offline

    Haloflooder

    @McSpazzy ^^^^This
    The plugin needs to warn the players when the server is going to restart. Maybe you should make a .yml to let the server owners put in an optional text when the plugin is going to restart the server in a couple seconds.
     
  23. Offline

    TehSkull

    Yeah, put that in, and I'd say you have a full-fledged plugin to release to the masses, and not just us.
     
  24. Offline

    McSpazzy

    @TehSkull Releasing to the masses is too much effort...people always think they deserve something
     

Share This Page