Java: Performance problem using Thread.sleep()

Java: Performance problem using Thread.sleep()

Post by Yoav Frandze » Fri, 11 Jan 2002 00:34:17



I am running Java version 1.3.0.00 on an HP-UX 11.0 machine.
When running a simple test program that calls Thread.sleep(999000), Glance
(gpm) shows approximately 50 system calls/sec to nanosleep, and a CPU usage
of approx. 0.4%. top shows the thread as "running". This is rather strange
(and problematic) behavior, about which I have not found any documentation.

The following are the specifics of the machine I am working on:
 HP-UX B.11.00 E 9000/782 2014951655

Java packages installed:

  Java2-JDK13_base      1.3.0.01       Java 2 SDK (700/800), PA1.1 Portable
  Java2-JDK13_perf      1.3.0.01       Java 2 SDK (700/800), PA2.0
Performance Add On
  Java2-RTE13_base      1.3.0.01       Java 2 RTE 1.3 (700/800), PA1.1
Portable
  Java2-RTE13_perf      1.3.0.01       Java 2 RTE (700/800), PA2.0
Performance Add On
  OVOPC-SE-GUI          A.05.56        IT/Operations Special Edition Java UI

Any clues?

Thanks

 
 
 

Java: Performance problem using Thread.sleep()

Post by Ken Gree » Fri, 11 Jan 2002 04:36:43



> I am running Java version 1.3.0.00 on an HP-UX 11.0 machine.
> When running a simple test program that calls Thread.sleep(999000), Glance
> (gpm) shows approximately 50 system calls/sec to nanosleep, and a CPU usage
> of approx. 0.4%. top shows the thread as "running". This is rather strange
> (and problematic) behavior, about which I have not found any documentation.

I can't help you with the java bit, but the fact that top says the VM as
running all
the time is what I'd expect :-(

Unfortunately top and ps always show multithreaded processes as being in the
run
state.

 
 
 

Java: Performance problem using Thread.sleep()

Post by Rick Jone » Fri, 11 Jan 2002 09:02:59



> I am running Java version 1.3.0.00 on an HP-UX 11.0 machine.  When
> running a simple test program that calls Thread.sleep(999000),
> Glance (gpm) shows approximately 50 system calls/sec to nanosleep,
> and a CPU usage of approx. 0.4%. top shows the thread as
> "running". This is rather strange (and problematic) behavior, about
> which I have not found any documentation.
> ...
> Any clues?

My _guess_ would be that there are other things being checked-for 50
times a second and that is why your "sleep" is being implemented as a
series of short catnaps.

You _might_ be able to get more information about what else is being
called by taking a prospect profile of the app. I suspect that you
would need to shorten the sample interval and let it sample for a
rather long time.

Another option _might_ be to single-step through the thing with sstep
(part of tusc) or perhaps even in a de*.

Does Glance show any other system calls at the same time (tusc would
if you prefer that).

ftp://ftp.cup.hp.com/dist/networking/tools/

If you were running on IPF you might be able to get data out of the
Caliper tool and the instrumentation it can insert into an app.

rick jones
--
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to raj in cup.hp.com  but NOT BOTH...

 
 
 

1. thread/sleep problem on HPUX

I am having a problem with my program on HPUX.  The main function
spawns four threads with the default attributes.  One thread calls the
sleep function, passing it the number of seconds to sleep. Everything
works fine until the other threads begin to process.  The sleep
function is called but it never returns.  When the other threads begin
to process again the sleep funtion finally returns.  When the threads
are done processing the sleep function does not return. Is this a
thread scheduling/priority problem or is there a bug in the sleep
program?  Any suggestions?
Thanks
George

Sent via Deja.com http://www.deja.com/
Before you buy.

2. comp.dcom.sys.cisco Frequently Asked Questions (FAQ)

3. Interoperability of Java Green Threads and DCE CMA Threads on HPUX 10.20

4. 970cse and Windows 2000

5. Internal DCE Threads problem under JAVA

6. Hard Drive Problems

7. HP-UX 10.10 problems: threads and signals [DCE threads]

8. need simulation information on client/server comp. architecture

9. Java VM on HPUX 11.0: support of native threads???

10. Java 1.1.3 - Native Threads for 10.20??

11. java rmi registry threads

12. HPUX 10.20 DCE threads, MMAP performance

13. HP-UX 11.00 Java 1.2 uses 65MB RAM by default at startup ?