设置 HEAPPROFILE 后,jetty 立即退出

我想分析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相同的结果之前)。

可能很难解决。环境因素太多。


阿晨1998
浏览 200回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java