Constantly high CPU on development [1.4.2.x]

Hi, I have constantly high CPU during development, even if there are no connections or application logic running. The high CPU usage came in with meteor 1.4.2.x and currently my CPU is running at 100 % on my project during development.

I tried it on the mac of my colleague, but there happens the same. It’s weird, as I made some test, creating blank new meteor projects and just copied the imports folder without resolving any modules and I get high cpu usage there too since 1.4.2.x

In short: I made some test. Found out, that the high cpu depends on how many files and/or dependencies are within my project, made a github issue but I can’t find a solution or workaround.

I tried to reinstall meteor, reset my project, profiled it with kadira - but I can’t find a solution. Does anybody else have similar issues and any ideas, what else can I try?

I noticed the same and am glad I am not the only one. May I ask how many files you have? The project I am working on has 1857 when I include my public folder, and 140 when just counting code and templates (rough estimate).

You can fallback to the other version while it gets fixed?

I am on OS X, so I just took a sample of the node process with the high load in Activity Monitor, and it is full of stuff like this … I don’t have a comparison to a 1.3 project. Maybe someone else can check their node process?

Call graph:
    2266 Thread_10169181   DispatchQueue_1: com.apple.main-thread  (serial)
    + 1861 start  (in node) + 52  [0x100001734]
    + ! 1855 node::Start(int, char**)  (in node) + 625  [0x100661191]
    + ! : 1827 uv_run  (in node) + 321  [0x10078541b]
    + ! : | 1264 uv__io_poll  (in node) + 696  [0x100793fa3]
    + ! : | + 1264 kevent  (in libsystem_kernel.dylib) + 10  [0x7fff9824ceca]
    + ! : | 557 uv__io_poll  (in node) + 1621  [0x100794340]
    + ! : | + 468 uv__async_io  (in node) + 136  [0x100784f67]
    + ! : | + ! 468 uv__async_event  (in node) + 198  [0x100784dd4]
    + ! : | + !   466 uv__work_done  (in node) + 178  [0x100783175]
    + ! : | + !   : 447 node::ZCtx::After(uv_work_s*, int)  (in node) + 251  [0x10068362b]
    + ! : | + !   : | 398 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*)  (in node) + 606  [0x10064e028]
    + ! : | + !   : | + 398 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*)  (in node) + 276  [0x10015f0c4]
    + ! : | + !   : | +   398 v8::internal::Invoke(bool, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*)  (in node) + 728  [0x1002d30c8]
    + ! : | + !   : | +     397 ???  (in <unknown binary>)  [0x386426c15b62]
    + ! : | + !   : | +     ! 396 ???  (in <unknown binary>)  [0x386426c318fd]
    + ! : | + !   : | +     ! : 355 ???  (in <unknown binary>)  [0x38643cc7ae40]
    + ! : | + !   : | +     ! : | 355 ???  (in <unknown binary>)  [0x386426c09ff7]
    + ! : | + !   : | +     ! : |   353 ???  (in <unknown binary>)  [0x386434835d5f]
    + ! : | + !   : | +     ! : |   + 352 ???  (in <unknown binary>)  [0x38642a69aa7f]
    + ! : | + !   : | +     ! : |   + ! 315 ???  (in <unknown binary>)  [0x38643ccb39ef]
    + ! : | + !   : | +     ! : |   + ! : 156 ???  (in <unknown binary>)  [0x38643cc8aa4e]
    + ! : | + !   : | +     ! : |   + ! : | 147 ???  (in <unknown binary>)  [0x38643cc8adbd]
    + ! : | + !   : | +     ! : |   + ! : | + 147 ???  (in <unknown binary>)  [0x38643cc7c669]
    + ! : | + !   : | +     ! : |   + ! : | +   146 ???  (in <unknown binary>)  [0x3864274c2d33]
    + ! : | + !   : | +     ! : |   + ! : | +   ! 145 ???  (in <unknown binary>)  [0x38643cc7d27a]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : 144 ???  (in <unknown binary>)  [0x38643cc7d41e]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : | 144 ???  (in <unknown binary>)  [0x38643cc72a64]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   134 ???  (in <unknown binary>)  [0x38643cc8b2dc]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   + 134 ???  (in <unknown binary>)  [0x386426c09ff7]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   132 ???  (in <unknown binary>)  [0x38642a6e581e]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! 125 ???  (in <unknown binary>)  [0x38643482e33a]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! : 125 ???  (in <unknown binary>)  [0x386426c09ff7]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   124 ???  (in <unknown binary>)  [0x38642a6e5887]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   | 124 ???  (in <unknown binary>)  [0x38643482c4c0]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   117 ???  (in <unknown binary>)  [0x38642a6f41bc]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + 116 ???  (in <unknown binary>)  [0x3864276ce225]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + ! 116 ???  (in <unknown binary>)  [0x386426c09ff7]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   113 ???  (in <unknown binary>)  [0x38642a6e5887]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : 89 ???  (in <unknown binary>)  [0x38642a650c76]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | 35 ???  (in <unknown binary>)  [0x38642a6e92c1]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + 32 ???  (in <unknown binary>)  [0x38642a68872c]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + ! 32 ???  (in <unknown binary>)  [0x386426c09ff7]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   13 ???  (in <unknown binary>)  [0x3864277c2fbb]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : 12 ???  (in <unknown binary>)  [0x386426c0963b]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | 11 v8::internal::Builtin_ArraySlice(int, v8::internal::Object**, v8::internal::Isolate*)  (in node) + 1247  [0x1001a210f]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + 9 v8::internal::CallJsBuiltin(v8::internal::Isolate*, char const*, v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)0>)  (in node) + 613  [0x1001a6605]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + ! 9 v8::internal::Invoke(bool, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*)  (in node) + 728  [0x1002d30c8]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !   9 ???  (in <unknown binary>)  [0x386426c15b62]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !     9 ???  (in <unknown binary>)  [0x386426c318f9]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !       9 ???  (in <unknown binary>)  [0x386426c09ff7]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !         5 ???  (in <unknown binary>)  [0x38643cc52476]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !         : 2 ???  (in <unknown binary>)  [0x3864277eb541]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !         : | 2 ???  (in <unknown binary>)  [0x386426c0963b]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !         : |   1 v8::internal::Runtime_AddElement(int, v8::internal::Object**, v8::internal::Isolate*)  (in node) + 313  [0x1005380e9]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !         : |   + 1 v8::internal::JSObject::SetOwnElementIgnoreAttributes(v8::internal::Handle<v8::internal::JSObject>, unsigned int, v8::internal::Handle<v8::internal::Object>, PropertyAttributes, v8::internal::JSObject::ExecutableAccessorInfoHandling)  (in node) + 227  [0x100476f13]
    + ! : | + !   : | +     ! : |   + ! : | +   ! : |   +   ! :   |   + !   : | + !   : | + !         : |   +   1 v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, PropertyAttributes, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed)  (in node) + 77  [0x100472e6d]

Hi @jamgold,
thx for your reply.
I have more than 1000 files within my imports folder approximately and it’s on OSX too. And it seems it get worse and worse and worse.

Heres a snippet of my process sample:

Call graph:
    2447 Thread_7933552   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2447 start  (in node) + 52  [0x100001734]
    +   2447 node::Start(int, char**)  (in node) + 625  [0x100661191]
    +     1817 uv_run  (in node) + 580  [0x10078551e]
    +     ! 1727 uv__run_timers  (in node) + 38  [0x10078ff0a]
    +     ! : 1721 timer_cb  (in node) + 74  [0x100782668]
    +     ! : | 1617 uv_fs_stat  (in node) + 228  [0x10078893b]
    +     ! : | + 1220 post  (in node) + 21  [0x100782ef9]
    +     ! : | + ! 1214 uv_mutex_lock  (in node) + 9  [0x10078f705]
    +     ! : | + ! : 1209 _pthread_mutex_lock_slow  (in libsystem_pthread.dylib) + 300  [0x7fff899bf5f5]
    +     ! : | + ! : | 1196 _pthread_mutex_lock_wait  (in libsystem_pthread.dylib) + 89  [0x7fff899c1e4a]
    +     ! : | + ! : | + 1196 __psynch_mutexwait  (in libsystem_kernel.dylib) + 10,20  [0x7fff86844de6,0x7fff86844df0]
    +     ! : | + ! : | 13 _pthread_mutex_lock_wait  (in libsystem_pthread.dylib) + 92,89  [0x7fff899c1e4d,0x7fff899c1e4a]
    +     ! : | + ! : 4 _pthread_mutex_lock_slow  (in libsystem_pthread.dylib) + 241,73,...  [0x7fff899bf5ba,0x7fff899bf512,...]
    +     ! : | + ! : 1 pthread_mutex_lock  (in libsystem_pthread.dylib) + 0  [0x7fff899bf45c]
    +     ! : | + ! 4 uv_mutex_lock  (in node) + 13,0  [0x10078f709,0x10078f6fc]
    +     ! : | + ! 2 pthread_mutex_lock  (in libsystem_pthread.dylib) + 7  [0x7fff899bf463]
    +     ! : | + 215 uv_mutex_unlock  (in node) + 9  [0x10078f740]
    +     ! : | + ! 209 _pthread_mutex_unlock_drop  (in libsystem_pthread.dylib) + 60  [0x7fff899c1d8c]
    +     ! : | + ! : 209 __psynch_mutexdrop  (in libsystem_kernel.dylib) + 10  [0x7fff86844dce]
    +     ! : | + ! 5 _pthread_mutex_unlock_slow  (in libsystem_pthread.dylib) + 86,290  [0x7fff899bf8ad,0x7fff899bf979]
    +     ! : | + ! 1 __psynch_mutexdrop  (in libsystem_kernel.dylib) + 0  [0x7fff86844dc4]
    +     ! : | + 166 post  (in node) + 73  [0x100782f2d]
    +     ! : | + ! 162 uv_cond_signal  (in node) + 9  [0x10078f9ab]
    +     ! : | + ! : 145 _pthread_cond_signal  (in libsystem_pthread.dylib) + 609  [0x7fff899c0528]
    +     ! : | + ! : | 145 __psynch_cvsignal  (in libsystem_kernel.dylib) + 10  [0x7fff86844d9e]
    +     ! : | + ! : 8 _pthread_cond_signal  (in libsystem_pthread.dylib) + 609,304,...  [0x7fff899c0528,0x7fff899c03f7,...]
    +     ! : | + ! : 5 _pthread_cond_signal  (in libsystem_pthread.dylib) + 633  [0x7fff899c0540]
    +     ! : | + ! : | 3 _pthread_cond_updateval  (in libsystem_pthread.dylib) + 60,1,...  [0x7fff899c2c32,0x7fff899c2bf7,...]
    +     ! : | + ! : | 2 OSAtomicCompareAndSwapPtrBarrier$VARIANT$mp  (in libsystem_platform.dylib) + 8,3  [0x7fff9b4169e4,0x7fff9b4169df]
    +     ! : | + ! : 3 OSAtomicCompareAndSwapIntBarrier$VARIANT$mp  (in libsystem_platform.dylib) + 6,0,...  [0x7fff9b4169c2,0x7fff9b4169bc,...]
    +     ! : | + ! : 1 pthread_cond_signal  (in libsystem_pthread.dylib) + 0  [0x7fff899c392b]
    +     ! : | + ! 2 pthread_cond_signal  (in libsystem_pthread.dylib) + 2  [0x7fff899c392d]
    +     ! : | + ! 2 uv_cond_signal  (in node) + 1  [0x10078f9a3]
    +     ! : | + 9 post  (in node) + 85,28,...  [0x100782f39,0x100782f00,...]
    +     ! : | + 3 uv__work_submit  (in node) + 42  [0x100782f69]
    +     ! : | + ! 2 uv_once  (in node) + 9  [0x10078f815]
    +     ! : | + ! : 2 pthread_once  (in libsystem_pthread.dylib) + 0  [0x7fff899c1b5c]
    +     ! : | + ! 1 uv_once  (in node) + 1  [0x10078f80d]
    +     ! : | + 3 uv_mutex_unlock  (in node) + 9  [0x10078f740]
    +     ! : | + 1 uv__work_submit  (in node) + 49  [0x100782f70]
    +     ! : | 100 uv_fs_stat  (in node) + 137  [0x1007888e0]
    +     ! : | + 56 uv__strdup  (in node) + 18  [0x100783512]
    +     ! : | + ! 56 strlen  (in libsystem_c.dylib) + 14,76,...  [0x7fff9506912e,0x7fff9506916c,...]
    +     ! : | + 37 uv__strdup  (in node) + 33  [0x100783521]
    +     ! : | + ! 36 malloc  (in libsystem_malloc.dylib) + 42  [0x7fff8f5010cc]
    +     ! : | + ! : 35 malloc_zone_malloc  (in libsystem_malloc.dylib) + 71  [0x7fff8f5025a1]
    +     ! : | + ! : | 17 szone_malloc_should_clear  (in libsystem_malloc.dylib) + 292  [0x7fff8f502705]
    +     ! : | + ! : | + 13 tiny_malloc_from_free_list  (in libsystem_malloc.dylib) + 417,385,...  [0x7fff8f50385d,0x7fff8f50383d,...]
    +     ! : | + ! : | + 2 tiny_malloc_from_free_list  (in libsystem_malloc.dylib) + 1391  [0x7fff8f503c2b]
    +     ! : | + ! : | + ! 2 get_tiny_free_size  (in libsystem_malloc.dylib) + 1,67  [0x7fff8f506480,0x7fff8f5064c2]
    +     ! : | + ! : | + 2 tiny_malloc_from_free_list  (in libsystem_malloc.dylib) + 1443  [0x7fff8f503c5f]
    +     ! : | + ! : | +   2 tiny_free_list_add_ptr  (in libsystem_malloc.dylib) + 384,1  [0x7fff8f505c84,0x7fff8f505b05]
    +     ! : | + ! : | 6 szone_malloc_should_clear  (in libsystem_malloc.dylib) + 80,76,...  [0x7fff8f502631,0x7fff8f50262d,...]
    +     ! : | + ! : | 5 szone_malloc_should_clear  (in libsystem_malloc.dylib) + 112  [0x7fff8f502651]
    +     ! : | + ! : | + 4 os_lock_lock  (in libsystem_platform.dylib) + 0  [0x7fff9b4167c4]
    +     ! : | + ! : | + 1 _os_lock_spin_lock  (in libsystem_platform.dylib) + 0  [0x7fff9b4167ca]
    +     ! : | + ! : | 3 szone_malloc  (in libsystem_malloc.dylib) + 0  [0x7fff8f5025d3]
    +     ! : | + ! : | 2 os_lock_lock  (in libsystem_platform.dylib) + 3  [0x7fff9b4167c7]
    +     ! : | + ! : | 1 os_lock_unlock  (in libsystem_platform.dylib) + 3  [0x7fff9b4168f1]
    +     ! : | + ! : | 1 szone_malloc_should_clear  (in libsystem_malloc.dylib) + 1093  [0x7fff8f502a26]
    +     ! : | + ! : |   1 _os_lock_spin_unlock  (in libsystem_platform.dylib) + 0  [0x7fff9b4168f4]
    +     ! : | + ! : 1 malloc_zone_malloc  (in libsystem_malloc.dylib) + 1  [0x7fff8f50255b]
    +     ! : | + ! 1 malloc  (in libsystem_malloc.dylib) + 1  [0x7fff8f5010a3]
    +     ! : | + 5 uv__strdup  (in node) + 57  [0x100783539]
    +     ! : | + ! 5 _platform_memmove$VARIANT$Nehalem  (in libsystem_platform.dylib) + 0,112,...  [0x7fff9b416560,0x7fff9b4165d0,...]
    +     ! : | + 1 DYLD-STUB$$_platform_memmove  (in libsystem_platform.dylib) + 0  [0x7fff9b41b46a]
    +     ! : | + 1 uv__strdup  (in node) + 21  [0x100783515]
    +     ! : | 4 uv_fs_stat  (in node) + 50,230,...  [0x100788889,0x10078893d,...]
    +     ! : 5 timer_cb  (in node) + 13,28  [0x10078262b,0x10078263a]
    +     ! : 1 timer_cb  (in node) + 37  [0x100782643]
    +     ! :   1 uv_now  (in node) + 1  [0x10078478f]
    +     ! 87 uv__run_timers  (in node) + 24  [0x10078fefc]
    +     ! : 60 uv_timer_stop  (in node) + 105,279,...  [0x10078fcef,0x10078fd9d,...]
    +     ! : 27 uv_timer_stop  (in node) + 264  [0x10078fd8e]
    +     ! :   27 heap_node_swap  (in node) + 110,30,...  [0x10078ffa0,0x10078ff50,...]
    +     ! 3 uv__run_timers  (in node) + 54,45,...  [0x10078ff1a,0x10078ff11,...]
    +     588 uv_run  (in node) + 321  [0x10078541b]
    +     ! 544 uv__io_poll  (in node) + 696  [0x100793fa3]
    +     ! : 544 kevent  (in libsystem_kernel.dylib) + 10  [0x7fff86845eca]
    +     ! 44 uv__io_poll  (in node) + 1621  [0x100794340]
    +     !   43 uv__async_io  (in node) + 136  [0x100784f67]
    +     !   | 43 uv__async_event  (in node) + 198  [0x100784dd4]
    +     !   |   36 uv__work_done  (in node) + 178  [0x100783175]
    +     !   |   + 19 poll_cb  (in node) + 494  [0x10078249b]
    +     !   |   + ! 18 uv_timer_start  (in node) + 293,42,...  [0x10078fc45,0x10078fb4a,...]
    +     !   |   + ! 1 uv_timer_start  (in node) + 275  [0x10078fc33]
    +     !   |   + !   1 heap_node_swap  (in node) + 19  [0x10078ff45]
    +     !   |   + 15 poll_cb  (in node) + 435  [0x100782460]
    +     !   |   + ! 15 uv_fs_req_cleanup  (in node) + 36  [0x100788f6b]
    +     !   |   + !   15 uv__free  (in node) + 27  [0x1007835c1]
    +     !   |   + !     4 free  (in libsystem_malloc.dylib) + 61  [0x7fff8f503ed5]
    +     !   |   + !     : 4 szone_size  (in libsystem_malloc.dylib) + 227,0,...  [0x7fff8f504124,0x7fff8f504041,...]
    +     !   |   + !     4 szone_free_definite_size  (in libsystem_malloc.dylib) + 1261  [0x7fff8f50486b]
    +     !   |   + !     : 4 get_tiny_previous_free_msize  (in libsystem_malloc.dylib) + 70  [0x7fff8f505afb]
    +     !   |   + !     4 szone_free_definite_size  (in libsystem_malloc.dylib) + 2385,1324,...  [0x7fff8f504ccf,0x7fff8f5048aa,...]
    +     !   |   + !     1 _os_lock_spin_lock  (in libsystem_platform.dylib) + 12  [0x7fff9b4167d6]
    +     !   |   + !     1 free  (in libsystem_malloc.dylib) + 289  [0x7fff8f503fb9]
    +     !   |   + !     1 szone_free_definite_size  (in libsystem_malloc.dylib) + 3094  [0x7fff8f504f94]
    +     !   |   + !       1 tiny_free_list_remove_ptr  (in libsystem_malloc.dylib) + 271  [0x7fff8f5065e2]
    +     !   |   + 2 poll_cb  (in node) + 28  [0x1007822c9]
    +     !   |   4 uv__work_done  (in node) + 141,159,...  [0x100783150,0x100783162,...]
    +     !   |   3 uv__work_done  (in node) + 44  [0x1007830ef]
    +     !   |     3 uv_mutex_lock  (in node) + 9  [0x10078f705]
    +     !   |       3 _pthread_mutex_lock_slow  (in libsystem_pthread.dylib) + 300  [0x7fff899bf5f5]
    +     !   |         3 _pthread_mutex_lock_wait  (in libsystem_pthread.dylib) + 89  [0x7fff899c1e4a]
    +     !   |           3 __psynch_mutexwait  (in libsystem_kernel.dylib) + 10  [0x7fff86844de6]

Anybody else have similar issues?

can it be that node_modules is being watched?

Weirdest thing, overnight the CPU% dropped to <10%. Apparently the number of files watched don’t play a role.

Check if your ram usage is not too high. I’ve seen this high CPU when it started swapping a lot.

Thanks, but this is on a MacPro with copious RAM. No memory issues.