我想分析jetty的堆外内存使用情况。
所以我使用 gperftools 并将 env 添加到 jetty.sh:
export LD_PRELOAD=/usr/local/lib/libtcmalloc.so
# export HEAPPROFILE=/home/cccccc/perftools/mybin
它工作正常
[root@xxx ~]# lsof -n | grep tcmalloc
java 23200 root mem REG 253,1 2350880 667001 /usr/local/lib/libtcmalloc.so.4.5.3
java 23200 23203 root mem REG 253,1 2350880 667001 /usr/local/lib/libtcmalloc.so.4.5.3
java 23200 23204 root mem REG 253,1 2350880 667001 /usr/local/lib/libtcmalloc.so.4.5.3
java 23200 23205 root mem REG 253,1 2350880 667001 /usr/local/lib/libtcmalloc.so.4.5.3
但是当我注释掉HEAPPROFILE并尝试service jetty restart(start).
登录后
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Dumping heap profile to /home/cccccc/perftools/mybin.0001.heap (Exiting, 0 bytes in use)
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
Starting Jetty: Starting tracking the heap
Starting tracking the heap
Starting tracking the heap
ok Thu Sep 20 20:33:36 CST 2018
它不干了。
离我的范围太远了。
我使用gperftools-2.7with libunwind-1.2.1(在我使用libunwind-0.99-BETA相同的结果之前)。
可能很难解决。环境因素太多。
相关分类