This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
内存泄露排查: | |
1.找到PID: ps -ef|grep '[进程名关键字]' | |
2.间隔打印当前GC情况:jstat -gcutil [PID] [间隔打印的毫秒数] | |
3.查看当前内存排名前20的对象实例:jmap -histo:live [PID]|head -20 | |
4.如果不明确,下载内存dump文件:jmap -dump:live,format=b,file=[path+fileName.hprof] [PID] | |
5.MAT工具(https://www.eclipse.org/mat/downloads.php)分析dump文件,关注泄露点:Leaks,查看内存占比 | |
CPU消耗排查: | |
1.找到PID: ps -ef|grep '[进程名关键字]' | |
2.找到进程PID消耗cpu最多的线程:TID: ps -Lfp [PID] 或者 top -Hp [PID] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I use JedisPool to connect redis,but it loss data. | |
codes are: | |
public void afterPropertiesSet() throws Exception { | |
Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>(); | |
//Jedis Cluster will attempt to discover cluster nodes automatically | |
String[] servers = server.split(";|,"); | |
for (String str : servers) { | |
String[] ap = str.split(":"); |