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 207950 - com.sun.jna.Function.invokeVoid[native] counted as running CPU
Summary: com.sun.jna.Function.invokeVoid[native] counted as running CPU
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 7.2
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: issues@profiler
Depends on:
Reported: 2012-01-31 13:04 UTC by David Strupl
Modified: 2012-05-22 13:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description David Strupl 2012-01-31 13:04:42 UTC
The JNA invocation is counted as if the CPU was used by the thread. In the case of calling some method which is blocked (like in the following thread in NetBeans:

 "Thread-5" - Thread t@32
    java.lang.Thread.State: RUNNABLE
	at com.sun.jna.Function.invokeVoid(Native Method)
	at com.sun.jna.Function.invoke(
	at com.sun.jna.Function.invoke(
	at com.sun.jna.Library$Handler.invoke(
	at $Proxy6.CFRunLoopRun(Unknown Source)
	at org.netbeans.modules.masterfs.watcher.macosx.OSXNotifier$
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$

) it might be marked as non-using the CPU not to confuse the users.
Comment 1 J Bachorik 2012-05-22 13:25:08 UTC
Do you propose to count all native invocations as blocking ones? 

The trouble is that you can not tell for sure whether a native call is blocking or not ...
Comment 2 David Strupl 2012-05-22 13:59:59 UTC
Not all. Only the "well" known ones. At least for NetBeans there are just 2 of them: one on MacOSX (as shown on the stack trace org.netbeans.modules.masterfs.watcher.macosx.OSXNotifier$ The other one would be on Windows.