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 69277 - Write thread dump to messages.log
Summary: Write thread dump to messages.log
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Performance (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
: 1035 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-24 16:40 UTC by Antonin Nebuzelsky
Modified: 2011-05-25 11:47 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2005-11-24 16:40:35 UTC
It would be useful to have an action in the IDE to write thread dump text into
messages.log. Currently the only way to dump thread information is on console.
The action could have an icon on toolbar (why not the Memory toolbar). I believe
that method Thread.getAllStackTraces() could be used for that.
Comment 1 _ rkubacki 2005-11-24 22:11:06 UTC
it is nice OTOH the expectation of UI designers is that this should not be
exposed too much.

BTW: if you run on mustang there should be 'jps' for finding proces ID and
'jstack' to generate the thread dump so even if the IDE is started without
console it should be possible to generate the dump. Of course this does not
solve the requirement to print it into messages.log
Comment 2 _ rkubacki 2006-08-12 21:04:44 UTC
perhaps we can hook into thread dump request with JVMTI agent registering
callback for DataDumpRequest. Given that jps is part of Sun's JDK distro this is
low priority.
Comment 3 _ rkubacki 2006-09-11 22:00:08 UTC
Dirty trick how to send thread dump into log (though not the same file as IDE log):

-J-XX:+UnlockDiagnosticVMOptions -J-XX:+LogVMOutput -J-XX:LogFile=vm.log

This RFE will be probably won't fix unless we want to add native code for this.
Comment 4 _ gtzabari 2006-09-11 22:09:11 UTC
Why can't you use Throwable.getStackTrace() for this? It probably does not
include as much information as the JRE dump (might be missing information about
monitors) but it's worth a look.
Comment 5 _ rkubacki 2006-09-12 06:19:35 UTC
There are two different ideas:

1) reroute thread dump produced currently on signal from console to log (or
duplicate it there). I'd like to implemnt this but do not see a way.

2) Add UI for printing dump. This can be achieved as Gili suggests but maybe it
can be useful as some experimental module. Still your code has to run so at
least EDT has to allow processing. Personally I consider this too low priority.
Feel free to write such plugin.
Comment 6 _ gtzabari 2006-09-12 06:24:45 UTC
Wouldn't this issue be tied to the RFE for automated filing of bug reports?
Unfortunately, I don't have the issue number handy, but it seems to me that
these two RFEs might be related in some way.
Comment 7 _ rkubacki 2006-09-12 07:38:06 UTC
Automated filing of bugs: it might be usefull for certain types OTOH I do not
think we have to tie these two issues together as they can be done independently.
Comment 8 _ rkubacki 2007-01-04 20:40:55 UTC
*** Issue 1035 has been marked as a duplicate of this issue. ***
Comment 9 David Strupl 2007-01-04 22:49:17 UTC
Fuj, this is a duplicate of #1035, not vice versa. Why did you make this one as
the primary one? It would be kind of nice to fix #1035, wouldn't it? ;-)