CrashPrevention
CrashPrevention | Prevent out of memory errors!
This is a simple plugin designed to help prevent your server crashing with out of memory errors. Every 10 seconds the server will check how much free RAM the JVM has left. If it's below an amount defined in the config, the server will automatically restart.
Configuration:
minimum_ram: 256 # Restart the server if below this amount of free RAM.
tries: 2 # Number of times to check free RAM before restarting. If under the minimum_ram two times, restart.
But, how can this actually restart it?
You need need to use one of these startup scripts: Linux | Windows
But, I use a control panel and can't change the start up script!
Even easier then! Most control panels (MutliCraft and TCAdmin anyway..) will automatically restart the server if it's stopped from outside their control panel. So you should be fine.
@zachoz I have actually tried it out first ;) but being active and constantly adding new features to the plugin won't be a bad idea :P
@RepDude
It does work for 1.5... Actually trying it out first helps. ;)
Update for 1.5 please.
Is it possible that you could make the messages that it broadcasts customizable in the config?
@zedadiaswick
Okay done. Just waiting for the file to be approved.
Edit: It's approved. Go download! :)
@zedadiaswick
I was actually thinking about implementing that when I made this. If I get time I'll add this later tonight. :)
My JVM assigns more memory as it is needed, meaning it will dip below 200 and then allocate more memory. With this plugin, this means it initiate a restart, then assigns extra memory bringing the available memory up to 300-400MB or more again.
Could you add in some delay against this, or to cancel the restart if more memory becomes available? Say initiate a quiet 40 second countdown, if after 10 seconds the available memory is still below the threshold then announce a 30 second timer to shutdown? (Of course it would be best if the delay were configurable)
Amazing plugin keep up the good work