减少玩家数据在内存时间
parent
c6d13b6685
commit
b88a69ef3a
|
@ -45,7 +45,7 @@ public class UserManager {
|
|||
private static Map<Integer,Long> userMapPutTime = new ConcurrentHashMap<>(); //离线读入
|
||||
private static AtomicInteger login_f_num = new AtomicInteger(0);//登陆计数
|
||||
private static final int LOGIN_F_LIMIT = 100;//报警界限
|
||||
private static final long LIVE_TIME = 12 * 60 * 60 * 1000L;
|
||||
private static final long LIVE_TIME = 3 * 60 * 60 * 1000L;
|
||||
|
||||
public static void addUser(User user) {
|
||||
userMap.put(user.getId(), user);
|
||||
|
|
|
@ -180,6 +180,9 @@ public abstract class TaskKit {
|
|||
// 最佳的线程数 = CPU可用核心数 / (1 - 阻塞系数)
|
||||
// TODO 阻塞系数是不是需要有个setter方法能让使用者自由设置呢?
|
||||
num = (int)(cores / (1 - 0.9));
|
||||
if (num > 8) {
|
||||
num = 8;
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
// 异常发生时姑且返回10个任务线程池
|
||||
|
|
Loading…
Reference in New Issue