I'm not sure but I think your antilag just closes the run.bat and not the process .
|
REP+ to who fixes this
hi when my server resets by itself it seams to creatate another java process and leave the others running. EG after 7 hours of running and restarting i would have like 20java processes hogging ram and mazing it out. im not sure why this happens? can someone please look at this and give me a solution? thanks.
ANTILAG.JAVA
Code:import java.io.*; public class antilag { public int ResetTimer = 0; public void resetserver() { PlayerHandler.kickAllPlayers = true; misc.println("Restarting PK PerthScape."); ResetTimer = 0; closeListener(); runserver(); } public void process() { ResetTimer += 1; if(ResetTimer >= 14000) { resetserver(); } } public void runserver() { try { String run = "Run.bat"; String xstr = "./"+run; Runtime.getRuntime().exec(xstr); } catch (IOException ioe) { ioe.printStackTrace(); } } public void closeListener() { try { server.shutdownClientHandler = true; if(server.clientListener != null) server.clientListener.close(); server.clientListener = null; } catch(java.lang.Exception __ex) { __ex.printStackTrace(); } } }
I'm not sure but I think your antilag just closes the run.bat and not the process .
make sure you close all you threads when it starts up a new server
what it does is on the console window it says SHUTTING DOWN... then RESTARTING... and that window does not close or anything but the window become inactive... eg it does not show new events... Why should i need the server to restart?
In your run.bat have this I think:
Code:@echo off taskkill /f /im java.exe java server
'taskkill' is not recognized as an internal or external command,
operable program or batch file.
help?
my normal thing isCode:@echo off title PK PerthScape Server color 0e java -Xmx512m -cp .;./Class; server
delete antilag and your done
why delete anti lag?
EDIT**
if i delete it and i compile i get 100 errors...
EDIT**
whats another way of getting run.cmd to kill a task?
Ahhh okay then, replace your current runserver() method with this one..
That should work.Code:public void runserver() { try { String run = "Run.bat"; String xstr = "./"+run; Runtime.getRuntime().exec(xstr); System.exit(0); } catch (IOException ioe) { ioe.printStackTrace(); } }
thanks... i will go off to airport now and check if my ram is maxed when i get back
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |