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 250077 - CPU usage at 100% for ~73 seconds while Truffle debugging
Summary: CPU usage at 100% for ~73 seconds while Truffle debugging
Status: VERIFIED WONTFIX
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-28 16:41 UTC by Jiri Kovalsky
Modified: 2015-02-02 12:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Self sampled profiling snapshot of IDE during the high CPU load. (15.90 KB, application/octet-stream)
2015-01-28 16:41 UTC, Jiri Kovalsky
Details
Project reproducing the high CPU load. (15.77 KB, application/x-java-archive)
2015-01-28 16:42 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2015-01-28 16:41:34 UTC
Created attachment 151711 [details]
Self sampled profiling snapshot of IDE during the high CPU load.

Product Version: NetBeans IDE Dev (Build 201501280002)
Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b17
System: Linux version 3.13.0-24-generic running on amd64; UTF-8; en_US (nb)

Description:
============
Something weird is happening when Truffle debugger is used. Maybe it's just a consequence of exceptions (#250068) but I think it's not related. When Java breakpoint is hit after execution of JavaScript code the IDE starts to occupy 100% of CPU for more than a minute. Then it falls down to zero. See profiling snapshot attached.

Steps to reproduce:
===================
1. Download, install and register GraalVM [1] as new "JDK 1.8 Graal" platform.
2. Open attached JavaApplication10 project and make sure it uses that Java platform.
3. Toggle line 30 breakpoint in JavaApplication10.java file.
4. Press Ctrl+F5 to start debugging the project.
5. If Exceptions Reporter opens, just close it and watch CPU load. It should soon start to operate at 100% and after a minute it will end without any reason.

[1] http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html
Comment 1 Jiri Kovalsky 2015-01-28 16:42:09 UTC
Created attachment 151712 [details]
Project reproducing the high CPU load.
Comment 2 Martin Entlicher 2015-01-30 14:25:01 UTC
Reproduced.
The CPU is spent in the program that is being debugged.
It has nothing to do with debugger, this can be proved by adding following code to the end of main() method:
        try {
            Thread.sleep(60000);
        } catch (InterruptedException iex) {}
and executing via Run.
The executed program consumes all available CPUs and jstack shows that it's consumed by four threads named Graal CompilerThread numbered 0-3.
Comment 3 Jiri Kovalsky 2015-02-02 12:23:14 UTC
OK, thanks for looking into this anyway. Verifying.