Ask a Question related to Sun Solaris, Design and Development.
-
edw #1
Count threads of a Java program
All,
I'm running quite a big java application on a solaris 8 machine.
All I want to know now is, how many java threads this application has.
Now, I know, that each LWP contains at least one java thread, so I can
make a lower boundary. But I can not tell, how many there really are.
I tried a lot of things like ps -L, or prstat -L ending up with a NLWP
number, but not the actual thread count.
Changing the application is also not an option, as we do not have the
source of it :-(
Is there anyone who can help with this?
Thanx a lot
EDW.
edw Guest
-
Integrating html/java/xml code into flash program
Ok im fairly new to flash, i wrote myself a webpage using ms frontpage that basicly has a searchbar and go button for the 6 or so major sites that i... -
cfexec problem when running certain java program
Did you find a resolution for this? I'm also looking for a way to use SSH and have run into some problems as well. -
calling a java program with shell_exec()
Hi, I couldn't compile php with java support on Mac OS X so I thought I'd call my java program with shell_exec(). It does work for simple... -
To count a number of lines in C++ or Java or ASCII files by exluding white spaces and comments
Hi all, We have huge files in Java and C++ and I need to count the total number of lines in each of them by excluding white spaces (from the... -
problem : SNMP port used when starting my java program
> I'm trying to send a TRAP PDU using a java SNMP stack can I send SNMP packets using another port??? -
Matthias Ernst #2
Re: Count threads of a Java program
edw wrote:
Send a SIGQUIT to the process (kill -QUIT <pid>). A thread dump will be> All,
>
> I'm running quite a big java application on a solaris 8 machine.
> All I want to know now is, how many java threads this application has.
dumped to stderr or stdout. No worry, the VM will keep running ! You can
grep 'prio=' | wc -l or somesuch on that dump to count the threads. Apart
from the number, these dumps can be highly interesting for the debugging
reader...
Matthias
--
Matthias Ernst
Software Engineer
CoreMedia - Smart Content Technology
Matthias Ernst Guest
-
Stephen Kellett #3
Re: Count threads of a Java program
In message <qoj0ivccqhgrojff1f8s562c8l0ql0apat@4ax.com>, Roedy Green
<roedy@mindprod.com> writesWrite a helper DLL using JVMPI or JVMDI and count the thread creation in>On 24 Jul 2003 13:37:25 -0700, [email]edw@gmx.at[/email] (edw) wrote or quoted :
>>>>I'm running quite a big java application on a solaris 8 machine.
>>All I want to know now is, how many java threads this application has.
>>Now, I know, that each LWP contains at least one java thread, so I can
>>make a lower boundary.
>You might modify the Thread constructor to add one to a count and
>display it. Then put your modified class file in rt.jar.
that. You can printf to the console or put up your own GUI to display
the details. You'll need to be familiar with C/C++ though.
The JVMDI also has a high level Java interface, but I couldn't comment
about this.
Java tools for Windows (in beta) [url]http://www.softwareverify.com[/url]
--
Stephen Kellett
Object Media Limited [url]http://www.objmedia.demon.co.uk[/url]
RSI Information: [url]http://www.objmedia.demon.co.uk/rsi.html[/url]
Stephen Kellett Guest
-
edw #4
Re: Count threads of a Java program
Stephen Kellett <snail@objmedia.demon.co.uk> wrote in message news:<uaDsU8H$RQI$EwgP@objmedia.demon.co.uk>...
Thanx a lot, but programming is no option here and solaris is not very> In message <qoj0ivccqhgrojff1f8s562c8l0ql0apat@4ax.com>, Roedy Green
> <roedy@mindprod.com> writes>> >On 24 Jul 2003 13:37:25 -0700, [email]edw@gmx.at[/email] (edw) wrote or quoted :
> >> >> >>I'm running quite a big java application on a solaris 8 machine.
> >>All I want to know now is, how many java threads this application has.
> >>Now, I know, that each LWP contains at least one java thread, so I can
> >>make a lower boundary.
> >You might modify the Thread constructor to add one to a count and
> >display it. Then put your modified class file in rt.jar.
> Write a helper DLL using JVMPI or JVMDI and count the thread creation in
> that. You can printf to the console or put up your own GUI to display
> the details. You'll need to be familiar with C/C++ though.
>
> The JVMDI also has a high level Java interface, but I couldn't comment
> about this.
>
> Java tools for Windows (in beta) [url]http://www.softwareverify.com[/url]
familiar with dlls ;-)
edw.
edw Guest
-
edw #5
Re: Count threads of a Java program
Matthias Ernst <matthias.ernst@coremedia.com> wrote in message news:<bfr05t$hoett$1@ID-133822.news.uni-berlin.de>...
This is a true operations solution. Worked like a charm. Thanx a lot :-)> edw wrote:
>>> > All,
> >
> > I'm running quite a big java application on a solaris 8 machine.
> > All I want to know now is, how many java threads this application has.
> Send a SIGQUIT to the process (kill -QUIT <pid>). A thread dump will be
> dumped to stderr or stdout. No worry, the VM will keep running ! You can
> grep 'prio=' | wc -l or somesuch on that dump to count the threads. Apart
> from the number, these dumps can be highly interesting for the debugging
> reader...
>
> Matthias
edw.
edw Guest
-
Sami Lakka #6
Re: Count threads of a Java program
If you don't want to use JVMPI or JDI you could just run the program in
debugger that shows the running threads. Graphical debuggers usually has
this functionality (for example Eclipse). You can also use the hprof
profiler
that is distributed with Sun's JVM. Just type Java -Xrunhprof
applicationToBeProfiled.
HProf dumps the profiling data of that application, and as I remember it
also shows
the thread count.
- Sami
"edw" <edw@gmx.at> wrote in message
news:84ea18d7.0307240502.70e58f82@posting.google.c om...> All,
>
> I'm running quite a big java application on a solaris 8 machine.
> All I want to know now is, how many java threads this application has.
> Now, I know, that each LWP contains at least one java thread, so I can
> make a lower boundary. But I can not tell, how many there really are.
> I tried a lot of things like ps -L, or prstat -L ending up with a NLWP
> number, but not the actual thread count.
> Changing the application is also not an option, as we do not have the
> source of it :-(
>
> Is there anyone who can help with this?
> Thanx a lot
> EDW.
Sami Lakka Guest



Reply With Quote

