- Joined
- Mar 24, 2009
- Messages
- 173
- Reaction score
- 18
1) Remove the RMI. RMI causes more lag because of ObjectOutputStream/ObjectInputStream.
2) Replace the RMI with a faster method, like TCP/IP
3) Most server OutOfMemoryErrors are caused by cache overflow. Occasionally clear the cache.
4) Do NOT call System.gc(). gc() will only cause more leaks to happen.
5) Xmx is not a good way of allocating extra memory. You should fix the memory leaks, rather than try to force more memory into the JVM.
6) Close all PreparedStatements/ResultSets after use. A lot of leaks happen because of that.
6) Instead of Object obj, use WeakReference<Object> obj
7) Do not call classes which DON'T have to be loaded. Even better, create 2 projects for LoginServer/WorldServer
8) Rather than String s = "String " + " String", use StringBuilder sb = new StringBuilder(); sb.append(..);
2) Replace the RMI with a faster method, like TCP/IP
3) Most server OutOfMemoryErrors are caused by cache overflow. Occasionally clear the cache.
4) Do NOT call System.gc(). gc() will only cause more leaks to happen.
5) Xmx is not a good way of allocating extra memory. You should fix the memory leaks, rather than try to force more memory into the JVM.
6) Close all PreparedStatements/ResultSets after use. A lot of leaks happen because of that.
6) Instead of Object obj, use WeakReference<Object> obj
7) Do not call classes which DON'T have to be loaded. Even better, create 2 projects for LoginServer/WorldServer
8) Rather than String s = "String " + " String", use StringBuilder sb = new StringBuilder(); sb.append(..);

