[ 
https://issues.apache.org/jira/browse/NETBEANS-1359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16657857#comment-16657857
 ] 

Jan Lahoda commented on NETBEANS-1359:
--------------------------------------

Regarding why the internal classes are used: first, am I right that there is no 
public API to convert an instance of ThreadInfo into CompositeData? Assuming 
there's no such API, I asked the original author offline why something like 
'MBeanServer.invoke(<threadBean>, "dumpAllThreads", ...' is not used instead, 
and the answer was performance. My understanding is: this is effectively a 
profiler that runs in the same VM that is profiled. It is therefore crucial the 
overhead is kept minimal. So the current sampler is trying to defer all work 
that can be deferred to the point when the sampling stops (and so the 
additional overhead can't affect the outcomes of the sampling). So while the 
sampling runs, only the ThreadInfos are collected and stored (but to share 
memory, their stack traces are "interned"), and are only converted to 
CompositeData and written out to disk. Using invoke would not only be slower, 
but also more memory intensive, adding more overhead to the sampling. It would 
be ideal if there would be an API method to convert ThreadInfo to CompositeData 
which NetBeans could use.

> Profiling the IDE hangs when saving snapshot
> --------------------------------------------
>
>                 Key: NETBEANS-1359
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-1359
>             Project: NetBeans
>          Issue Type: Bug
>          Components: platform - JDK Problems
>    Affects Versions: 10.0
>            Reporter: Glenn Holmer
>            Assignee: Glenn Holmer
>            Priority: Blocker
>              Labels: netcat
>         Attachments: stacktrace.txt
>
>
> 1) Click "Profile the IDE" icon in the Performance toolbar to start profiling 
> the IDE.
> 2) Open some projects, files within them, etc. to create some activity for 
> the profiler.
> 3) Click the icon again (which is now labelled "Stop IDE Profiling and Take a 
> Snapshot").
> This last action should create and open a profiler snapshot, but the "Saving 
> snapshot" progress bar in the status area of NetBeans never goes anywhere and 
> a snapshot is not opened.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to