java - java -AbandonedConnectionCleanupThread 占用更多 CPU 时间
问题描述
我的应用程序正在从 csv 读取数据并插入 mysql.its 占用更多 CPU。
当我在 jdbc 下调试时,线程占用了更多的 cpu。
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:40)
森托斯,
1.顶部
7435 root 20 0 7677556 366436 14528 S 86.4 4.8 67:05.60 java
2.顶部
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
任何想法?
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();
每当listner收到csv时,我都会提交给Excutor服务
service.submit(new PerformanceFileReader(f));
解决方案
推荐阅读
- image - SSRS 表达式打开特定报告
- r - 如何提取出现最大值的矩阵的特定行和列
- nftables - nftables netdev 和 inet 钩子之间的区别
- python - Python:来自 csv-list 的值
- assembly - 在这个 MIPS 汇编程序中传递到标签是如何工作的?
- c# - Outlook for Office365 在发送前向用户显示消息
- python - 在 python 中替代 enumerate()
- c++ - QProcess如何请求Windows UAC绕过密码使用runAs从管理员帐户进行管理员级别命令
- javascript - 如何使用 React 使 Plain Three.js Canvas 跨越网页的视图高度和宽度?
- python - 使用 python 将 Hive 与 keytab 连接