You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by "Mueller, Stephen Ng" <sn...@sandia.gov> on 2006/06/10 02:09:46 UTC

Derby hogging CPU on startup

Hi,

I am using emdedded Derby for one of my applications.  After calling
connection.open() on the database, the connection is returned promptly
with no problem.  However, after this, my CPU usage goes to nearly 100%,
and my computer slows down.  I can perform inserts on the database while
this is happening, but they take a while.  Is Derby going through some
sort of start up procedure?  Should it be taking up this much CPU?  It
takes about a minute or so before completing, and my CPU usage returns
to normal.  Anyone know why this is happening and how/if I can alleviate
the problem?  FYI, I am using Derby 10.1.2.1.  

Thanks for the help,  
Stephen


Re: Derby hogging CPU on startup

Posted by Stanley Bradbury <St...@gmail.com>.
Mueller, Stephen Ng wrote:
>
> Hi,
>
> I am using emdedded Derby for one of my applications.  After calling 
> connection.open() on the database, the connection is returned promptly 
> with no problem.  However, after this, my CPU usage goes to nearly 
> 100%, and my computer slows down.  I can perform inserts on the 
> database while this is happening, but they take a while.  Is Derby 
> going through some sort of start up procedure?  Should it be taking up 
> this much CPU?  It takes about a minute or so before completing, and 
> my CPU usage returns to normal.  Anyone know why this is happening and 
> how/if I can alleviate the problem?  FYI, I am using Derby 10.1.2.1. 
>
> Thanks for the help, 
> Stephen
>
Hi -
Upon startup Derby loads many classes as it establishes the various 
caches and other DBMS management structures.  Also, Derby will process 
the transaction log if the database was not shutdown cleanly at the end 
of the previous boot session. 

Some things you could look at: Are you using one of the JVMs Derby is 
tested on?  If so the problem is probably not slow classloading.  Are 
there a number of large files in the 'log' directory?  This would 
indicate that a rollback needs to be performed during the startup process.


Re: Derby hogging CPU on startup

Posted by Andrew McIntyre <mc...@gmail.com>.
On 6/9/06, Mueller, Stephen Ng <sn...@sandia.gov> wrote:
>
> I am using emdedded Derby for one of my applications.  After calling
> connection.open() on the database, the connection is returned promptly with
> no problem.

What API is the connection.open() method from? It's not a JDBC method.

> However, after this, my CPU usage goes to nearly 100%, and my
> computer slows down.  I can perform inserts on the database while this is
> happening, but they take a while.  Is Derby going through some sort of start
> up procedure?

Derby start up, even on an underpowered desktop by today's standards
(where underpowered = 400 Mhz P3 or 450 Mhz G4) Derby startup
shouldn't take more than 10 seconds, even when creating a new
database.

> Should it be taking up this much CPU?  It takes about a
> minute or so before completing, and my CPU usage returns to normal.

No, I don't think this is normal, and I have not experienced this
behavior before. When starting Derby, there is usually an initial
spike, though not even to 100% in most cases, and then CPU usage
quickly returns to normal.

What platform and JVM are you using? Perhaps there is something odd
going on with the JVM here.

How much RAM do you have? Perhaps the machine is running out of
physical memory and there is an excessive amount of access to virtual
memory?

> Anyone know why this is happening and how/if I can alleviate the problem?  FYI, I
> am using Derby 10.1.2.1.

Nothing recent rings a bell. I've seen CPU spikes in the past, but not
recent past - back in the JDK 1.1-era. Any additional details
concerning your setup and how you are accessing Derby might be useful
in tracking down the problem.

Thanks,
andrew