100%CPU when using ScheduledThreadPoolExecutor only with GCJ

Andrew Haley aph@redhat.com
Fri Apr 30 17:49:00 GMT 2010


On 04/30/2010 06:45 PM, Lon Palmer wrote:
> GCJ 4.3
> 
> I have an application that makes use of several instances of ScheduledThreadPoolExecutor.  
> 
> When running as a Jar, this application uses very little CPU.  However, when running as a Linux compile (using gcj-4.3) classes using the ScheduledThreadPoolExecutor can use 100% CPU under no load.
> 
> I've only found one situation that will reliably cause the cpu spike in my application.
> 
> Class A has a private member which is a ScheduledThreadPoolExecutor.
> Class A assigns one task to it's S.T.P.E (15 ms rate).
> Class A has a private member Class B.
> Class B has a private member which is a ScheduledThreadPoolExecutor.
> Class B assigns one task to it's S.T.P.E. (60 ms rate).
> 
> When class A is instantiated in my application, the CPU usage jumps to 100%.  If I make class B reference the same S.T.P.E as is used in class A, the CPU usage doesn't seem to jump.
> 
> However, there are other places in my code in which classes want to use a S.T.P.E and I'm seeing CPU spikes to 100% that I'm not getting in the Jar.
> 
> Any help is appreciated.  I did a search in the Bugzilla DB for ScheduledThreadPoolExecutor and didn't find any entries.  
> 
> If this sounds like a bug instead of a mis-use of the class please let me know and I'll try to write a demonstration app this weekend.

Sounds like a bug to me.  Either way, we need a test case to demonstrate it.

Andrew.



More information about the Java mailing list