Is there any tips on how to make SMP servers run smoothly and have less lag or no lag at all? My server lags time to time when 95% RAM is not used and 50-70 MB of RAM is used.
Probably increase the ram and threads that Java is allowed to use. Are you running through a command line or through the GUI?
Way I have it is that I have the server.jar file in a folder and a .bat file to open it and the following string of commands to go along with it to set Java a certain way.
The first argument opens the Java Runtime
"C:\Program Files (x86)\Java\jre6\bin\java.exe"
The location may be different for you, this is an x64 system so if you run x86 it's probably just:
"C:\Program Files\Java\jre6\bin\java.exe"
The second argument:
-Xmx1024M
Sets the maximum heap for Java so that's how much it has to work with.
Third:
-Xms1024M
Sets the initial heap size so that's what it starts out with.
Fourth:
-XX:+AggressiveOpts
I'm not exactly sure about but it should increase performance
Fifth:
-XX:+UseConcMarkSweepGC
Is for garbage collection, making it run faster, pretty sure it's for multithreaded garbage collection
Sixth:
-XX:+UseParNewGC
I think that this is similar to "-XX:+UseParallelGC"
Seventh:
-XX:+CMSIncrementalPacing
More garbage collection options
Eighth:
-XX:ParallelGCThreads=4
Sets the number of threads that garbage collection can use. This will really help out a lot. I believe that by default you only use a single thread.
The rest of the arguments say where the jar is located and the "nogui" is an option for the server jar itself which tells it to not run with the GUI.
Way I have it is that I have the server.jar file in a folder and a .bat file to open it and the following string of commands to go along with it to set Java a certain way.
The first argument opens the Java Runtime
"C:\Program Files (x86)\Java\jre6\bin\java.exe"
The location may be different for you, this is an x64 system so if you run x86 it's probably just:
"C:\Program Files\Java\jre6\bin\java.exe"
The second argument:
-Xmx1024M
Sets the maximum heap for Java so that's how much it has to work with.
Third:
-Xms1024M
Sets the initial heap size so that's what it starts out with.
Fourth:
-XX:+AggressiveOpts
I'm not exactly sure about but it should increase performance
Fifth:
-XX:+UseConcMarkSweepGC
Is for garbage collection, making it run faster, pretty sure it's for multithreaded garbage collection
Sixth:
-XX:+UseParNewGC
I think that this is similar to "-XX:+UseParallelGC"
Seventh:
-XX:+CMSIncrementalPacing
More garbage collection options
Eighth:
-XX:ParallelGCThreads=4
Sets the number of threads that garbage collection can use. This will really help out a lot. I believe that by default you only use a single thread.
The rest of the arguments say where the jar is located and the "nogui" is an option for the server jar itself which tells it to not run with the GUI.
Most of this is just stuff that iv'e picked up by tinkering around and reading the following:
http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
There was also another thread about optimizing for multicore servers but I can't find it.
Wow, I totally neglected to talk about that. Have you tested your server on LAN?