2016-05-20 38 views
1

我的測試設置(Mocha + Karma)在閒置/監視模式下開始一直採用60%至70%cpu。我運行它像剖析nodejs CPU使用率過高(表示___inc_remove_counter)

NODE_ENV=test node_modules/.bin/karma start build/testing/karma.conf.js --no-single-run --auto-watch 

我升級從5.x節點 - >今天6.2,但沒有高CPU至今(使用6小時後)。我按照解釋here運行配置文件。這些是日誌

[Summary]: 
    ticks total nonlib name 
    12260 14.8% 16.4% JavaScript 
    57135 69.0% 76.5% C++ 
    2712 3.3% 3.6% GC 
    8112 9.8%   Shared libraries 
    5318 6.4%   Unaccounted 

[C++]: 
    ticks total nonlib name 
    36120 43.6% 48.3% ___inc_remove_counter 
    1151 1.4% 1.5% node::InitFs(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>, void*) 
    967 1.2% 1.3% _malloc_jumpstart 
    819 1.0% 1.1% v8::internal::IncrementalMarking::UpdateMarkingDequeAfterScavenge() 
[Bottom up (heavy) profile]: 
    Note: percentage shows a share of a particular caller in the total 
    amount of its parent calls. 
    Callers occupying less than 2.0% are not shown. 

    ticks parent name 
    36120 43.6% ___inc_remove_counter 

    5318 6.4% UNKNOWN 

    4923 5.9% /usr/local/bin/node 
    579 11.8% v8::internal::Builtins::~Builtins() 
    166 28.7%  LazyCompile: ~Socket._writeGeneric net.js:654:42 

[C++ entry points]: 
    ticks cpp total name 
    4637 25.0% 5.6% v8::internal::Builtins::~Builtins() 
    2385 12.8% 2.9% v8::internal::Runtime_GetProperty(int, v8::internal::Object**, v8::internal::Isolate*) 
    1943 10.5% 2.3% v8::internal::Runtime_KeyedStoreIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) 
    966 5.2% 1.2% v8::internal::Runtime_KeyedLoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) 
    881 4.7% 1.1% v8::internal::Runtime_CompileOptimized_Concurrent(int, v8::internal::Object**, v8::internal::Isolate*) 
    699 3.8% 0.8% v8::internal::Runtime_HasOwnProperty(int, v8::internal::Object**, v8::internal::Isolate*) 
    626 3.4% 0.8% v8::internal::Runtime_WeakCollectionSet(int, v8::internal::Object**, v8::internal::Isolate*) 
    562 3.0% 0.7% v8::internal::Runtime_SetProperty(int, v8::internal::Object**, v8::internal::Isolate*) 
    488 2.6% 0.6% v8::internal::Runtime_StackGuard(int, v8::internal::Object**, v8::internal::Isolate*) 
    416 2.2% 0.5% v8::internal::Runtime_HasProperty(int, v8::internal::Object**, v8::internal::Isolate*) 
    409 2.2% 0.5% v8::internal::Runtime_LoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) 
    373 2.0% 0.5% v8::internal::Runtime_StringCharCodeAtRT(int, v8::internal::Object**, v8::internal::Isolate*) 
    313 1.7% 0.4% ___inc_remove_counter 

什麼是___inc_remove_counter?我如何識別是什麼導致高CPU?

謝謝。

回答

0

雖然我清除了ny node_moules並重新安裝了所有的依賴關係,但我仍然遇到了這個問題。它通過清除緩存npm cache clean然後重新安裝所有代碼來解決。