This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270869 - CPU usage while IDE is idle on OSX
Summary: CPU usage while IDE is idle on OSX
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 8.2
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-13 12:16 UTC by florianbruckner
Modified: 2017-07-20 09:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Profiler snapshot while CPU usage is high with npm project open (111.35 KB, application/octet-stream)
2017-06-13 12:26 UTC, florianbruckner
Details
Profiler snapshot while CPU usage is low with npm project closed (39.66 KB, application/octet-stream)
2017-06-13 12:27 UTC, florianbruckner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description florianbruckner 2017-06-13 12:16:42 UTC
This issue has already been reported in 244034 and was closed as INCOMPLETE.

The IDE mostly works fine when it comes to performance for Java projects, nevertheless for Javascript/npm projects it doesn't. Creating a profiling snapshot while the IDE is idle shows 100% CPU time in a Thread "Thread-1", with a call stack from org.netbeans.modules.masterfs.watcher.macosx.OSXNotifier into com.sun.jna.Native invokeVoid().

I believe this has to do with either the project type or the number of files in the project - in the case where I am seeing this it is a Javascript/NPM project, with node_modules having a considerable size and number of files:

$ du -h -s node_modules
367M	node_modules
$ find node_modules | wc -l
   40584
$ 

Disabling "Enable auto-scanning of files" has not improved the situation. Closing the projects with node_modules in the group immediately brings CPU usage down, in the case I am looking at now down to around 10% in Activity Monitor from 130%.

I will upload a profiler snapshot from both scenarios for your consideration.
Comment 1 florianbruckner 2017-06-13 12:26:04 UTC
Created attachment 164522 [details]
Profiler snapshot while CPU usage is high with npm project open
Comment 2 florianbruckner 2017-06-13 12:27:47 UTC
Created attachment 164523 [details]
Profiler snapshot while CPU usage is low with npm project closed
Comment 3 florianbruckner 2017-06-13 12:30:02 UTC
Looking at the second snapshot one can still see that the thread takes 100% CPU time. Nevertheless, the hosts CPU is mostly idle, so maybe it sleeps in native code.
Comment 4 florianbruckner 2017-06-13 13:27:44 UTC
Did a bit of logging, and it does not seem to come from OSXNotifier - there are actually just a few events created from this.

I also can narrow down the project type a bit: The CPU usage is high when I open a project with a gulpfile, but not when it is plain npm.
Comment 5 dirkschaap 2017-07-20 09:07:47 UTC
Also head problems with very high CPU usage. Closing a random project in the Projects window reduced the CPU usage from 122%(!?) to around 2%.
Maybe this will give the developers a clue in fixing the problem!