您好,登錄后才能下訂單哦!
啟用tcmalloc編譯后,在測試機上調試啟動運行都沒有問題,但是上了線上服務器后就無法啟動,CPU占用還非常高,pstack看了下,死鎖了,線程全部卡在spinlock下面,又折回去發(fā)現(xiàn)在我開發(fā)機上就不會走到SpinLock::SlowLock這個函數(shù),沒轍,老老實實自己折騰個內存池吧
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
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經查實,將立刻刪除涉嫌侵權內容。