As far as I know, you can't without dropping to native (DLL or .so) code.
Ted Neward
{.NET||Java} Course Author & Instructor
DevelopMentor (http://www.develop.com)
http://www.javageeks.com/tneward/index.html
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Sankaran, Rajesh
> Sent: Thursday, August 30, 2001 10:39 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [EJB-INT] How to find process id of a java process?
>
>
> Actually, it's about how to find the process id of the java process from
> that java source itself. With Process and Runtime classes, we
> can find the
> total amount of memory in the JVM. Like that, how to get the
> process id of
> itself from the code?
>
> -----Original Message-----
> From: Matthew Hixson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 1:29 PM
> To: [EMAIL PROTECTED]
> Subject: Re: How to find process id of a java process?
>
>
> Since the thread dump comes from the JVM can't you just start it up like:
>
> java YourProgram 2>&1 > /tmp/thread_dump
>
> That way anything that comes out of the process on stdout or stderr will
> fall into that file.
> -M@
>
> --
> Matt Hixson
> Aventail Corporation
> Seattle, Washington
> www.aventail.com
>
> On Thu, 30 Aug 2001, Gene Chuang wrote:
>
> > Depends on your operating system. For Solaris/Unix, it's 'ps'.
> >
> > While we're on the topic of Java processes, I've got a question:
> >
> > We're running Solaris 2.7 + JDK 1.3.1, and I find one of the best
> debugging
> > "tools" for our J2EE application is 'kill -3 xxx', where xxx is the
> process
> > id. This of course produces a full thread dump and is
> extremely useful in
> > diagnosing a hung or deadlocked server. However, I was wondering if
> anyone
> > know how to redirect this output to, say, a log file, instead
> of standard
> > out? I've tried playing around with a all other kill signals (1-9), a
> > couple of them do produce a log file; but not with the thread dump.
> >
> > Gene
> >
> > -----Original Message-----
> > From: Sankaran, Rajesh [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, August 30, 2001 9:46 AM
> > To: [EMAIL PROTECTED]
> > Subject: How to find process id of a java process?
> >
> >
> > Hi all,
> >
> > This may not be an appropriate question in this list, but could someone
> > through light or directions on how to find out process id of a java
> process?
> >
> > Thanks.
> > Rajesh
> >
> >
> ==================================================================
> =========
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff EJB-INTEREST". For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
> >
> ==================================================================
> =========
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff EJB-INTEREST". For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
>
> ==================================================================
> =========
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ==================================================================
> =========
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".