Plugin category: Developer/Admin Tools Suggested name: AntiRestart What I want: Many people know that bukkit servers' memory usage increases over time until a restart. I propose a plugin that "restarts" the server without an actual shutdown. I know this may be a confusing topic so let me try to explain: A restart frees all the memory usage but annoys players. After a restart players play and memory usage builds. All the things causing the memory usage need to go but you have like 50 people on! You don't want to lose them! Instead use a plugin that does exactly what the restart does to free memory usage but without actually restarting. Does that make any sense? Ideas for commands: /ar, /antirestart, /ar restart (will actually restart), /ar freemem[ory] (does "restart"), /ar status (does exactly what LagMeter does within this plugin) Ideas for permissions: Must work with Vault and/or groupmanager antirestart.* - all permissions antirestart.restart - gives the command /ar restart antirestart.freememory - gives the command /ar freememory antirestart.status - gives the command /ar status When I'd like it by: Whenever available
Uh have you tried using /reload ? It is built in to Bukkit and deactivates all plugins and reactivate them.
But it DEFINITELY doesn't free up space. It does, however, cause crashes and memory-leaks with some plugins.
I don't know anything about the code inside so is it possible at all? /reload only reloads everything bringing all that memory hogging stuff back in. If this is not possible do you know of any other possible solutions?
You could very easily write a batch/shell script that restarts your server whenever it is shut down (after 3 seconds, if you want a delay to cancel it manually). Then you would just start your server using the script, and use /save-all, /stop. Technically save-all isn't required, but I've had some bad experiences just running stop.
You need a server wrapper. I used to use this: http://forums.bukkit.org/threads/ad...etection-auto-saves-remote-console-1-4-6.674/ Plugins don't work like that. Plugins are managed by a plugin manager within bukkit, so it could not work independently. Remote toolkit on the otherhand is not a plugin, it runs the craftbukkit.jar for you and manages various things such as restarts and even has a remote api.
amunro Can you explain to me how this works and what it does? My computer is maxed on RAM so I don't want a program running that does too much and uses my precious RAM. What about this crazy theory: A program that can run one bukkit.jar and on the "restart" it starts an identical one with the memory usage already reset. Any possible way for this to happen? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Thats exactly what remote toolkit does. It launches and manages your bukkit.jar for you. If it crashes, it will terminate it and spawn a new one. To setup: Download and extract the serverdir folder to your root server folder. Go into toolkit folder and edit wrapper.properties and put in the RAM you use, the minecraft server jar name and any other settings. Then to start your server, just run the rtoolkit.bat file.
amunro Cool! know of any plugins that will just do a restart? I have found some but they are for 1.1 or 1.2.5 and really outdated.
Not possible, as the plugin depends on Craftbukkit to work. If CraftBukkit would restart, the plugin would disable, causing the starting part of the plugin to never be called again.
Sounds to me you have some sort of memory leak if this is an issue. Chunks is the main thing that stays loaded that would effect your memory, if your players are roaming around and you just unload the "memory" they would probably fall into the void or crash. Restarting is probably your best option.
In an ideal world, yes this would be very possible, but I'm not familiar enough to give you an answer. I know that /reload reloads all plugins, but often the garbage collector will leave some things behind and this can cause serious memory issues. If bukkit (and plugins) were coded well enough, this would be very possible. I know improvements were made to the /reload command since I coded plugins, but I'm not sure what exactly they were. I would run some tests with the /reload command, and if you see it improving memory (doubtful), then try setup a cron to regularly execute the command. If that fails, your only option is to restart bukkit, which you can use remotetoolkit to do. Please note that remotetoolkit is not a plugin (it is easy to get confused). Its actually a wrapper that manages bukkit. Because remotetoolkit never shuts down, it can stop and start bukkit as it pleases. I also used to have memory issues as I once ran a server on an EC2 microinstance. There are plenty of resources about optimising your JVM to reduce ram usage. To be honest, if you are spotting a significant memory leak (the memory usage goes up over time), you should try removing plugins one by one until you spot which one it is, then report it to the developer. 99% of the time it's down to a plugin developer with bad coding practises who knows nothing of optimisation or garbage collection.