tcmalloc导致程序无法启动

简介:

启用tcmalloc编译后,在测试机上调试启动运行都没有问题,但是上了线上服务器后就无法启动,CPU占用还非常高,pstack看了下,死锁了,线程全部卡在spinlock下面,又折回去发现在我开发机上就不会走到SpinLock::SlowLock这个函数,没辙,老老实实自己折腾个内存池吧

Thread 5 (Thread 0x7f848c753700 (LWP 4197)):

#0  0x00007f8489a78fd0 in base::internal::SpinLockDelay(int volatile*, int, int) () from /usr/local/lib/libtcmalloc.so.4

#1  0x00007f8489a78dbc in SpinLock::SlowLock() () from /usr/local/lib/libtcmalloc.so.4

#2  0x00007f8489a69065 in tcmalloc::CentralFreeList::Populate() () from /usr/local/lib/libtcmalloc.so.4

#3  0x00007f8489a692a0 in tcmalloc::CentralFreeList::FetchFromOneSpansSafe(int, void**, void**) () from /usr/local/lib/libtcmalloc.so.4

#4  0x00007f8489a69343 in tcmalloc::CentralFreeList::RemoveRange(void**, void**, int) () from /usr/local/lib/libtcmalloc.so.4

#5  0x00007f8489a6d3e5 in tcmalloc::ThreadCache::FetchFromCentralCache(unsigned long, unsigned long) () from /usr/local/lib/libtcmalloc.so.4

#6  0x00007f8489a5c193 in (anonymous namespace)::cpp_alloc(unsigned long, bool) () from /usr/local/lib/libtcmalloc.so.4

#7  0x00007f8489a7bc98 in tc_new () from /usr/local/lib/libtcmalloc.so.4

#8  0x0000003f5309c3c9 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) () from /usr/lib64/libstdc++.so.6

#9  0x0000003f5309ddaa in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, unsigned long) () from /usr/lib64/libstdc++.so.6

#10 0x0000003f5309df6c in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) () from /usr/lib64/libstdc++.so.6

#11 0x00007f848a4c4708 in ?? ()

#12 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f848bd52700 (LWP 4199)):

#0  0x00007f8489a78fd0 in base::internal::SpinLockDelay(int volatile*, int, int) () from /usr/local/lib/libtcmalloc.so.4

#1  0x00007f8489a78dbc in SpinLock::SlowLock() () from /usr/local/lib/libtcmalloc.so.4

#2  0x00007f8489a6db63 in tcmalloc::ThreadCache::CreateCacheIfNecessary() () from /usr/local/lib/libtcmalloc.so.4

#3  0x00007f8489a5c2d6 in (anonymous namespace)::cpp_alloc(unsigned long, bool) () from /usr/local/lib/libtcmalloc.so.4

#4  0x00007f8489a7bc98 in tc_new () from /usr/local/lib/libtcmalloc.so.4

#5  0x00007f848a4b641f in ?? ()

#6  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f848b351700 (LWP 4200)):

#0  0x00007f8489a78fd0 in base::internal::SpinLockDelay(int volatile*, int, int) () from /usr/local/lib/libtcmalloc.so.4

#1  0x00007f8489a78dbc in SpinLock::SlowLock() () from /usr/local/lib/libtcmalloc.so.4

#2  0x00007f8489a69065 in tcmalloc::CentralFreeList::Populate() () from /usr/local/lib/libtcmalloc.so.4

#3  0x00007f8489a692a0 in tcmalloc::CentralFreeList::FetchFromOneSpansSafe(int, void**, void**) () from /usr/local/lib/libtcmalloc.so.4

#4  0x00007f8489a69343 in tcmalloc::CentralFreeList::RemoveRange(void**, void**, int) () from /usr/local/lib/libtcmalloc.so.4

#5  0x00007f8489a6d3e5 in tcmalloc::ThreadCache::FetchFromCentralCache(unsigned long, unsigned long) () from /usr/local/lib/libtcmalloc.so.4

#6  0x00007f8489a5c193 in (anonymous namespace)::cpp_alloc(unsigned long, bool) () from /usr/local/lib/libtcmalloc.so.4

#7  0x00007f8489a7bc98 in tc_new () from /usr/local/lib/libtcmalloc.so.4

#8  0x0000003f5309c3c9 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) () from /usr/lib64/libstdc++.so.6

#9  0x0000003f5309ddaa in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, unsigned long) () from /usr/lib64/libstdc++.so.6

#10 0x0000003f5309df6c in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) () from /usr/lib64/libstdc++.so.6

#11 0x00007f848a4fcfe3 in ?? ()

#12 0x6120726f6620257b in ?? ()

#13 0x6c6461206e692064 in ?? ()

Thread 1 (Thread 0x7f84a15f4700 (LWP 4026)):

#0  0x00007f8489a78fd0 in base::internal::SpinLockDelay(int volatile*, int, int) () from /usr/local/lib/libtcmalloc.so.4

#1  0x00007f8489a78dbc in SpinLock::SlowLock() () from /usr/local/lib/libtcmalloc.so.4

#2  0x00007f8489a6db63 in tcmalloc::ThreadCache::CreateCacheIfNecessary() () from /usr/local/lib/libtcmalloc.so.4

#3  0x00007f8489a5c2d6 in (anonymous namespace)::cpp_alloc(unsigned long, bool) () from /usr/local/lib/libtcmalloc.so.4

#4  0x00007f8489a7bc98 in tc_new () from /usr/local/lib/libtcmalloc.so.4

#5  0x0000003f5309c3c9 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) () from /usr/lib64/libstdc++.so.6

#6  0x0000003f5309cde5 in ?? () from /usr/lib64/libstdc++.so.6

#7  0x0000003f5309cf33 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) () from /usr/lib64/libstdc++.so.6


本文转自 zhegaozhouji 51CTO博客,原文链接:http://blog.51cto.com/1038741/1936988


相关文章
|
7月前
|
Linux
Linux rsyslog占用内存CPU过高解决办法
该文档描述了`rsyslog`占用内存过高的问题及其解决方案。
289 4
|
7月前
|
缓存 移动开发 关系型数据库
Linux 内存 占用较高问题排查
Linux 内存 占用较高问题排查
137 2
|
2月前
|
算法 Linux
Linux中内存问题
【10月更文挑战第6天】
53 2
|
7月前
|
Java Linux Arthas
linux上如何排查JVM内存过高?
linux上如何排查JVM内存过高?
1090 0
|
7月前
|
缓存 监控 Linux
如何实现 Linux 服务 Crash 后自动重启?
如何实现 Linux 服务 Crash 后自动重启?
|
Oracle 安全 关系型数据库
Linux的daemon进程对Oracle数据库的SGA使用大页内存的处理
Oracle对运行在机器内存超过32G上的数据库推荐使用HugePages 来容纳Oracle数据库的SGA,参见。
209 0
|
Arthas Java 测试技术
linux上怎么排查JVM内存过高?
想必工作一两年以后的同学都会逐渐面临到,jvm等问题,但是可能苦于无法熟练的使用一些工具;本文将介绍几个比较常用分析工具的使用方法,带着大家一步步定位分析问题。
2578 0
linux上怎么排查JVM内存过高?
|
关系型数据库 MySQL Linux
linux环境下 xampp mysql 启动失败问题排查 日志文件过大占用存储空间导致网站瘫痪
问题现象 网站莫名其妙的连接不上mysql了,导致网站瘫痪;没有改任何程序,怎么回事呢?马上用xshell 和xftp工具连接linux服务器来排查问题 启动xampp mysql /opt/lampp/lampp startmysql 启动xampp mysql ![/opt/lampp/bin/mysql.
3088 0
|
Linux NoSQL
(学习笔记)使用 Kdump 检查 Linux 内核崩溃
版权声明:转载请注明出处:http://blog.csdn.net/dajitui2024 https://blog.csdn.net/dajitui2024/article/details/79396544 ...
1528 0