|
From: Scott M. <sc...@so...> - 2006-07-07 18:07:12
|
Thank you for your comments/suggestions. It helped me focus on where the
problem was (my application). I had implemented a buffered IO reader to act
as a console to accept commands from the user running the application. When
running as a daemon, the concept of a console made no sense so I modified
the application so it wouldn't create the console in daemon mode and the
application is back to using less than 1/10 of a percent of the CPU. Thanks
for getting me focused in the right area.
Scott Myers
sc...@so...
-----Original Message-----
From: Leif Mortenson [mailto:le...@ta...]
Sent: Thursday, July 06, 2006 6:29 PM
To: sc...@so...; wra...@li...
Subject: Re: [Wrapper-user] Java app takes 99% CPU (Solaris) when run as
daemon
Scott,
Is it the Java process or the wrapper process that is eating up all
of your CPU? I'll
assume the java process for now. I have never heard of any problems
like this with
the wrapper in the past so I doubt that it is causing it.
On UNIX systems the difference between a console and daemon process
under
the wrapper is pretty minor. Should be no differences in the java
process. The
wrapper process will have been forked a couple extra times to turn it
into a detached
process however. The java process will then be the child process of
that resulting
process.
For starters, I would try sending a couple thread dump requests to
your application
using the wrapper's scripts. Look at each of the threads and make sure
that they
appear to be in locations that make sense. Most likely it is a tight
loop someplace.
You can also play with the JVM's -Xrunhprof command line to get the
JVM to do
CPU profiling. That will tell you exactly where the JVM is spending all
of its time.
Cheers,
Leif
Scott Myers wrote:
> I have a java application that I am testing with the wrapper. It
> works great so far under Windows and also
> under Solaris when run using the java -jar command and when run under
> the wrapper in console mode.
>
> For some reason, when I run it on Solaris (SunOS 5.9) under the
> wrapper as a daemon (start rather than
> console), the application consumes all available CPU. prstat shows the
> application percentage rapidly
> climbing to 99% and staying there.
>
> Does anyone have any ideas why the application would use 0.1% of the
> CPU on a Solaris system in console
> mode but 99% when run as a daemon (started)?
>
> Scott Myers
> sc...@so... <mailto:sc...@so...>
> (408) 973-8374
> www.softwareassist.net <http://www.softwareassist.net/>
>
|