我的应用正在从csv中读取数据并插入到mysql.its中,这会占用更多的cpu。
当我在jdbc线程下进行调试时,会占用更多的CPU。
CAST(COUNT(NULLIF(C.DateChanged, 0)) * 100.0 / COUNT(NULLIF(A.LastPassedBackToSalesDate, 0)) AS numeric(18, 2)) AS PBTSbutActived
Centos
1.top
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:40)
2。顶部
7435 root 20 0 7677556 366436 14528 S 86.4 4.8 67:05.60 java
有什么主意吗?
top -n 1 -H -p 7435
top - 15:48:23 up 57 days, 21 min, 11 users, load average: 0.47, 0.53, 0.62
Threads: 28 total, 1 running, 27 sleeping, 0 stopped, 0 zombie
%Cpu(s): 4.9 us, 3.3 sy, 0.0 ni, 91.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 7650496 total, 188012 free, 1122392 used, 6340092 buff/cache
KiB Swap: 16777212 total, 16775664 free, 1548 used. 5914108 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7595 root 20 0 7677556 345864 14528 R 60.0 4.5 142:04.27 java
7435 root 20 0 7677556 345864 14528 S 0.0 4.5 0:00.00 java
7436 root 20 0 7677556 345864 14528 S 0.0 4.5 0:01.24 java
7454 root 20 0 7677556 345864 14528 S 0.0 4.5 1:06.92 java
7459 root 20 0 7677556 345864 14528 S 0.0 4.5 1:07.11 java
每当列表接收者收到csv时,我都会提交给Excutor服务
ExecutorService service=Executors.newFixedThreadPool(count);
FileAlterationObserver fao = new FileAlterationObserver(folder);
fao.addListener(new FileListener(service));
final FileAlterationMonitor monitor = new FileAlterationMonitor(Integer.parseInt("100"));
monitor.addObserver(fao);
monitor.start();