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 190494 - High CPU usage
Summary: High CPU usage
Status: RESOLVED WORKSFORME
Alias: None
Product: ide
Classification: Unclassified
Component: Performance (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P3 normal with 3 votes (vote)
Assignee: Tomas Hurka
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2010-09-21 20:10 UTC by ademarco
Modified: 2012-06-13 13:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full thread dump 6.9.1 (9.09 KB, text/plain)
2010-09-21 20:10 UTC, ademarco
Details
Snapshot (309.97 KB, application/octet-stream)
2010-09-22 09:00 UTC, ademarco
Details
Netbeans contantly running 2 threads that heat CPU (task manager screenshot) (58.78 KB, image/png)
2011-02-22 15:37 UTC, olksy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ademarco 2010-09-21 20:10:54 UTC
Created attachment 102104 [details]
Full thread dump 6.9.1

I experience high cpu usage with NetBeans 6.9.1. It's enough to scroll into a file window for the CPU to jump high to 100% and more. I've tried also older versions and the problem is always there. I attach a thread dump, hope it will help in solving the issue.

Thanks a lot!
Comment 1 ademarco 2010-09-21 20:12:47 UTC
It might help, here my default options:

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"
Comment 2 ademarco 2010-09-22 07:29:24 UTC
Running NetBeans with the following options reduced the CPU usage:

 -J-server
 -J-Xverify:none
 -J-d64
 -J-Xss2m
 -J-Xms256m
 -J-Xmx512m
 -J-XX:PermSize=32m
 -J-XX:MaxPermSize=512m
 -J-Dsun.java2d.noddraw=true
 -J-Dsun.java2d.opengl=true
 -J-Dsun.java2d.d3d=false
 -J-Dawt.nativeDoubleBuffering=true
 -J-XX:+UseAdaptiveSizePolicy
 -J-Djava.net.preferIPv4Stack=true
 -J-XX:+AggressiveOpts
 -J-XX:+AggressiveHeap

From: http://stackoverflow.com/questions/2217140/java-settings-for-netbeans-6-8-on-osx-10-5-8-to-avoid-100-cpu-usage
Comment 3 Petr Nejedly 2010-09-22 08:38:40 UTC
In your thread dump, the IDE is not doing anything. I suspect that it is the concurrent garbage collector running in the background.

What was your java heap situation at the time?
(The concurrent collector might keep running if the IDE heap is more than 75% full, I think)
Comment 4 ademarco 2010-09-22 08:42:01 UTC
> What was your java heap situation at the time?

How can I see that?
Comment 5 Petr Nejedly 2010-09-22 08:51:32 UTC
There is a built-in memory meter.
Right click in the toolbar area anc check the "Memory" option.
(Or, from main menu: View->Toolbars->Memory)
Clicking the memory meter also forces gc().
Comment 6 ademarco 2010-09-22 09:00:28 UTC
Created attachment 102112 [details]
Snapshot

Here a snapshot taken using the Memory Toolbar.
Comment 7 nandocova 2010-09-24 01:45:03 UTC
I'm having a similar issue with Windows 7 x64. My PC has a quad-core processor and 6GB of RAM, I use the C/C++ plugin, and sometimes just by clicking on a variable name I get CPU usage around 40%. It stops after a couple of minutes and the CPU stays around 15% usage. I tried your options, but it didn't help. The same happens with NetBeans 6.7 and 6.8.
Comment 8 olksy 2011-02-22 15:37:28 UTC
Created attachment 106303 [details]
Netbeans contantly running 2 threads that heat CPU  (task manager screenshot)

This bug affects me permanently as well for C++ plugin. Both in Linux 64 and Windows 32 environment.

I see there are always two concurrent threads are running like on screenshot from windows task manager attached.

Though, memory usage is under 20% as for toolbar indication. That is why I believe that is not two concurrent garbage collection threads.

Furthermore, NetBeans does not shutdown clearly. Because in even 15 minutes after NetBeans main window was closed, I see netbeans.exe is still running and still consuming CPU.
Comment 9 Marian Mirilovic 2011-05-24 14:31:18 UTC
reassign to performance team for evaluation ...
Comment 10 Tomas Hurka 2011-06-10 08:04:26 UTC
When you have hi CPU usage, please use Profile Me Now! http://wiki.netbeans.org/FitnessViaPartnership to provide more information what is going on. Thanks.
Comment 11 Petr Cyhelsky 2012-06-13 13:27:59 UTC
Requested information not sent for more than a year -> closing