1、机器的对外IP:curl cip.cc
2、查看机器上两个ip的通信情况:sudo tcpdump host xxxxx and dst yyyy 查看从xxx发向yyy的数据包情况
3、dump堆内存:jmap -dump:format=b,file=1.dump 30190
查看堆中对象:jmap -histo:live 30190 > 30190.dump
jstat -gcutil 2531 2s 3(每隔2s共查看3次堆的情况)
4、查看线程占用的端口的情况
netstat -nap|grep 进程号
public static void main(String[] args) throws SocketException {
System.out.println("端口:" + DialingRobotUtils.isPortAvailable(8080));
DatagramSocket socket = new DatagramSocket(8080);
System.out.println(socket.isClosed());
socket.setSoTimeout(100);
System.out.println("端口:" + DialingRobotUtils.isPortAvailable(8080));
try {
byte[] data = {};
DatagramPacket packet = new DatagramPacket(data, 0);
socket.receive(packet);
} catch (IOException e) {
socket.close();
e.printStackTrace();
}
System.out.println("端口:" + DialingRobotUtils.isPortAvailable(8080));
System.out.println(socket.isClosed());
}
netstat -tunlp|grep 12411
netstat -nap | grep
------------------------
查看当前目录的各个文件夹的内存占用情况
du --max-depth=1 -h
https://www.cnblogs.com/flyingeagle/articles/9219106.html
------------------------------------------------------
tcpdump抓包信息
sudo tcpdump -i eth0 -vnn dst host 10.32.0.62 and dst port 20147 -w 1.pcap