Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 43898 invoked from network); 13 Jun 2006 06:20:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jun 2006 06:20:39 -0000 Received: (qmail 71670 invoked by uid 500); 13 Jun 2006 06:20:38 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 71286 invoked by uid 500); 13 Jun 2006 06:20:37 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 71273 invoked by uid 99); 13 Jun 2006 06:20:37 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2006 23:20:37 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [196.7.147.33] (HELO www33a.your-server.co.za) (196.7.147.33) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2006 23:20:32 -0700 Received: from [196.34.231.38] (helo=clive) by www33a.your-server.co.za with esmtp (Exim 4.51) id 1Fq2Fy-0003Vw-J7 for derby-user@db.apache.org; Tue, 13 Jun 2006 08:20:09 +0200 From: "Clive Borrageiro" To: "'Derby Discussion'" Subject: RE: Derby hogging CPU on startup Date: Tue, 13 Jun 2006 08:20:09 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <2606C38685A4FC4AAEB1E0B7963DF75301EF059D@ES22SNLNT.srn.sandia.gov> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Thread-Index: AcaMUWcB9xTgd+5iQtGxWV5GORZJ5ACMGn5wAAvH6gA= Message-Id: X-Virus-Scanned: Clear (ClamAV 0.88.1/1536/Mon Jun 12 23:07:37 2006) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Stephen, Try using DriverManager.getConnection("jdbc:derby:db;shutdown=true"); when exiting your application and see if that solves the CPU 100% spike on the next startup. Clive -----Original Message----- From: Mueller, Stephen Ng [mailto:snmuell@sandia.gov] Sent: 13 June 2006 03:33 AM To: Derby Discussion Subject: RE: Derby hogging CPU on startup Andrew, Thanks for the reply. Sorry, connection.open() is a method I wrote myself. To start the database, I make the following call in my application: DriverManager.getConnection(derbyURL +";create=false", username_, password_); The function returns fairly quickly, but then after that, as I said, the CPU usage spikes to nearly 100% for a couple minutes, then goes back down to normal. Note this problem only occurs when the database already exists. When I make the previous call when the database doesn't exist yet with create=true, I don't see this problem at all. The following are my system specs: Pentium M 2.13GHZ 2 GB RAM Windows XP SP2 Java 1.4.2_08 Derby 10.1.2.1 Stephen -----Original Message----- From: Andrew McIntyre [mailto:mcintyre.a@gmail.com] Sent: Friday, June 09, 2006 10:47 PM To: Derby Discussion Subject: Re: Derby hogging CPU on startup On 6/9/06, Mueller, Stephen Ng 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