Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 25838 invoked from network); 18 May 2007 22:30:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 May 2007 22:30:50 -0000 Received: (qmail 45271 invoked by uid 500); 18 May 2007 22:30:56 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 44847 invoked by uid 500); 18 May 2007 22:30:54 -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 44836 invoked by uid 99); 18 May 2007 22:30:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 15:30:54 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [32.97.182.144] (HELO e4.ny.us.ibm.com) (32.97.182.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 15:30:47 -0700 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l4IMUQDo022810 for ; Fri, 18 May 2007 18:30:26 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l4IMUQ1T550820 for ; Fri, 18 May 2007 18:30:26 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l4IMUQXZ022208 for ; Fri, 18 May 2007 18:30:26 -0400 Received: from [127.0.0.1] (sig-9-48-127-154.mts.ibm.com [9.48.127.154]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l4IMUO2V022188 for ; Fri, 18 May 2007 18:30:25 -0400 Message-ID: <464E28B8.1000202@sbcglobal.net> Date: Fri, 18 May 2007 15:29:12 -0700 From: Mike Matrigali Reply-To: mikem_app@sbcglobal.net User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Discussion Subject: Re: Embedded thread taking 100% cpu References: <619FD34741327C47AC7FBA8DBADBF5E0E194B0@ffex01.fnfr.com> In-Reply-To: <619FD34741327C47AC7FBA8DBADBF5E0E194B0@ffex01.fnfr.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org are you saying that if you stop your loop and do nothing then you see the cpu spinning at 100% "forever". The stack traces are what I would expect, and they may spin for 100% cpu for a short time depending on size of table and cache size as they may require no I/O. Anytime you delete all rows from a page as it seems your step 4 does, then work is queued to be activated when that transaction commits. At step 5 the work is processed, it basically reclaims the space freed by the committed deletes and makes it available for future inserts into the table. Adam Bovill wrote: > Hello, > > I seem to be having a problem with my embedded derby > "derby.rawStoreDeamon" thread where it takes up 100% of my CPU. > Everything else is still responsive, but this thread seems to be looping > through the following stack traces. Also, as soon as I make any > additional action on the Database, it returns to normal, so it seems > that I have done something to get it into a strange state. > > The following stack traces were taken by halting that thread multiple > times, they are not in any order. > > So this happens after repeating the following multiple times: > > > > 1. Add items to two tables. (3 items into one, 15 into the other) > > 2. Set autocommit = false > > 3. force commit > > 4. attempt to delete all the items (and they are successfully deleted) > > 5. force commit > > 6. set autocommit = true > > > > I set the autocommit to false so that I can roll back the changes if the > delete fails. > > > > It seems to just sit there and spin doing nothing. Have I done > something wrong with my commit logic? > > > > Thanks, > > Adam > > > > > > Thread [derby.rawStoreDaemon] (Suspended) > > LockControl.addLock(LockSet, Object, Object) line: not > available > > LockSet.lockObject(Object, Lockable, Object, int, Latch) > line: not available > > SinglePool.lockAnObject(Object, Object, Lockable, Object, > int, Latch) line: not available > > SinglePool.lockObject(Object, Object, Lockable, Object, int) > line: not available > > ContainerLocking3.lockContainer(Transaction, > ContainerHandle, boolean, boolean) line: not available > > BaseContainerHandle.useContainer(boolean, boolean) line: not > available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int, boolean) line: not available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int) line: not available > > InternalXact(Xact).openContainer(ContainerKey, > LockingPolicy, int) line: not available > > OpenHeap(OpenConglomerate).init(ContainerHandle, > Conglomerate, int[], TransactionManager, Transaction, boolean, int, int, > LockingPolicy, DynamicCompiledOpenConglomInfo) line: not available > > Heap.open(TransactionManager, Transaction, boolean, int, > int, LockingPolicy, StaticCompiledOpenConglomInfo, > DynamicCompiledOpenConglomInfo) line: not available > > RAMTransaction.openConglomerate(Conglomerate, boolean, int, > int, int, StaticCompiledOpenConglomInfo, DynamicCompiledOpenConglomInfo) > line: not available > > RAMTransaction.openConglomerate(long, boolean, int, int, > int) line: not available > > B2I.lockTable(TransactionManager, int, int, int) line: not > available > > BTreePostCommit.performWork(ContextManager) line: not > available > > BasicDaemon.serviceClient(ServiceRecord) line: not > available > > BasicDaemon.work(boolean) line: not available > > BasicDaemon.run() line: not available > > Thread.run() line: not available > > > > > > > > > > Thread [derby.rawStoreDaemon] (Suspended) > > OpenHeap(OpenConglomerate).init(ContainerHandle, > Conglomerate, int[], TransactionManager, Transaction, boolean, int, int, > LockingPolicy, DynamicCompiledOpenConglomInfo) line: not available > > Heap.open(TransactionManager, Transaction, boolean, int, > int, LockingPolicy, StaticCompiledOpenConglomInfo, > DynamicCompiledOpenConglomInfo) line: not available > > RAMTransaction.openConglomerate(Conglomerate, boolean, int, > int, int, StaticCompiledOpenConglomInfo, DynamicCompiledOpenConglomInfo) > line: not available > > RAMTransaction.openConglomerate(long, boolean, int, int, > int) line: not available > > B2I.lockTable(TransactionManager, int, int, int) line: not > available > > BTreePostCommit.performWork(ContextManager) line: not > available > > BasicDaemon.serviceClient(ServiceRecord) line: not > available > > BasicDaemon.work(boolean) line: not available > > BasicDaemon.run() line: not available > > Thread.run() line: not available > > > > > > > > > > Thread [derby.rawStoreDaemon] (Suspended) > > BaseContainerHandle.useContainer(boolean, boolean) line: not > available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int, boolean) line: not available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int) line: not available > > InternalXact(Xact).openContainer(ContainerKey, > LockingPolicy, int) line: not available > > OpenHeap(OpenConglomerate).init(ContainerHandle, > Conglomerate, int[], TransactionManager, Transaction, boolean, int, int, > LockingPolicy, DynamicCompiledOpenConglomInfo) line: not available > > Heap.open(TransactionManager, Transaction, boolean, int, > int, LockingPolicy, StaticCompiledOpenConglomInfo, > DynamicCompiledOpenConglomInfo) line: not available > > RAMTransaction.openConglomerate(Conglomerate, boolean, int, > int, int, StaticCompiledOpenConglomInfo, DynamicCompiledOpenConglomInfo) > line: not available > > RAMTransaction.openConglomerate(long, boolean, int, int, > int) line: not available > > B2I.lockTable(TransactionManager, int, int, int) line: not > available > > BTreePostCommit.performWork(ContextManager) line: not > available > > BasicDaemon.serviceClient(ServiceRecord) line: not > available > > BasicDaemon.work(boolean) line: not available > > BasicDaemon.run() line: not available > > Thread.run() line: not available > > > > > > > > > > Thread [derby.rawStoreDaemon] (Suspended) > > LinkedList.addBefore(E, Entry) line: not available > > LinkedList.add(E) line: not available > > LockControl.addWaiter(List, Lock, LockSet) line: not > available > > LockControl.addLock(LockSet, Object, Object) line: not > available > > LockSet.lockObject(Object, Lockable, Object, int, Latch) > line: not available > > SinglePool.lockAnObject(Object, Object, Lockable, Object, > int, Latch) line: not available > > SinglePool.lockObject(Object, Object, Lockable, Object, int) > line: not available > > ContainerLocking3.lockContainer(Transaction, > ContainerHandle, boolean, boolean) line: not available > > BaseContainerHandle.useContainer(boolean, boolean) line: not > available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int, boolean) line: not available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int) line: not available > > InternalXact(Xact).openContainer(ContainerKey, > LockingPolicy, int) line: not available > > OpenHeap(OpenConglomerate).init(ContainerHandle, > Conglomerate, int[], TransactionManager, Transaction, boolean, int, int, > LockingPolicy, DynamicCompiledOpenConglomInfo) line: not available > > Heap.open(TransactionManager, Transaction, boolean, int, > int, LockingPolicy, StaticCompiledOpenConglomInfo, > DynamicCompiledOpenConglomInfo) line: not available > > RAMTransaction.openConglomerate(Conglomerate, boolean, int, > int, int, StaticCompiledOpenConglomInfo, DynamicCompiledOpenConglomInfo) > line: not available > > RAMTransaction.openConglomerate(long, boolean, int, int, > int) line: not available > > B2I.lockTable(TransactionManager, int, int, int) line: not > available > > BTreePostCommit.performWork(ContextManager) line: not > available > > BasicDaemon.serviceClient(ServiceRecord) line: not > available > > BasicDaemon.work(boolean) line: not available > > BasicDaemon.run() line: not available > > Thread.run() line: not available > > > > > > > > > > Thread [derby.rawStoreDaemon] (Suspended) > > Thread.setPriority0(int) line: not available [native method] > > Thread.setPriority(int) line: not available > > FileMonitor(BaseMonitor).setThreadPriority(int) line: not > available > > FileMonitor.run() line: not available > > AccessController.doPrivileged(PrivilegedExceptionAction) > line: not available [native method] > > FileMonitor.setThreadPriority(int) line: not > available > > BasicDaemon.yield() line: not available > > BasicDaemon.work(boolean) line: not available > > BasicDaemon.run() line: not available > > Thread.run() line: not available > > > > > > > > > > Thread [derby.rawStoreDaemon] (Suspended) > > TransactionTable.add(Xact, boolean) line: not available > > XactFactory.add(Xact, boolean) line: not available > > XactFactory.pushTransactionContext(ContextManager, String, > Xact, boolean, RawStoreFactory, boolean) line: not available > > XactFactory.startInternalTransaction(RawStoreFactory, > ContextManager) line: not available > > RawStore.startInternalTransaction(ContextManager) line: not > available > > RAMTransaction.getInternalTransaction() line: not > available > > BTreePostCommit.performWork(ContextManager) line: not > available > > BasicDaemon.serviceClient(ServiceRecord) line: not > available > > BasicDaemon.work(boolean) line: not available > > BasicDaemon.run() line: not available > > Thread.run() line: not available > > > > > > Thread [derby.rawStoreDaemon] (Suspended) > > BaseContainerHandle.useContainer(boolean, boolean) line: not > available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int, boolean) line: not available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int) line: not available > > InternalXact(Xact).openContainer(ContainerKey, > LockingPolicy, int) line: not available > > OpenHeap(OpenConglomerate).init(ContainerHandle, > Conglomerate, int[], TransactionManager, Transaction, boolean, int, int, > LockingPolicy, DynamicCompiledOpenConglomInfo) line: not available > > Heap.open(TransactionManager, Transaction, boolean, int, > int, LockingPolicy, StaticCompiledOpenConglomInfo, > DynamicCompiledOpenConglomInfo) line: not available > > RAMTransaction.openConglomerate(Conglomerate, boolean, int, > int, int, StaticCompiledOpenConglomInfo, DynamicCompiledOpenConglomInfo) > line: not available > > RAMTransaction.openConglomerate(long, boolean, int, int, > int) line: not available > > B2I.lockTable(TransactionManager, int, int, int) line: not > available > > BTreePostCommit.performWork(ContextManager) line: not > available > > BasicDaemon.serviceClient(ServiceRecord) line: not > available > > BasicDaemon.work(boolean) line: not available > > BasicDaemon.run() line: not available > > Thread.run() line: not available > > > > > > > > > > Thread [derby.rawStoreDaemon] (Suspended) > > LinkedList.remove(Entry) line: not available > > LinkedList.remove(Object) line: not available > > LockControl.removeWaiter(List, Object, LockSet) line: not > available > > LockControl.giveUpWait(Object, LockSet) line: not > available > > LockSet.lockObject(Object, Lockable, Object, int, Latch) > line: not available > > SinglePool.lockAnObject(Object, Object, Lockable, Object, > int, Latch) line: not available > > SinglePool.lockObject(Object, Object, Lockable, Object, int) > line: not available > > ContainerLocking3.lockContainer(Transaction, > ContainerHandle, boolean, boolean) line: not available > > BaseContainerHandle.useContainer(boolean, boolean) line: not > available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int, boolean) line: not available > > BaseDataFileFactory.openContainer(RawTransaction, > ContainerKey, LockingPolicy, int) line: not available > > InternalXact(Xact).openContainer(ContainerKey, > LockingPolicy, int) line: not available > > OpenHeap(OpenConglomerate).init(ContainerHandle, > Conglomerate, int[], TransactionManager, Transaction, boolean, int, int, > LockingPolicy, DynamicCompiledOpenConglomInfo) line: not available > > Heap.open(TransactionManager, Transaction, boolean, int, > int, LockingPolicy, StaticCompiledOpenConglomInfo, > DynamicCompiledOpenConglomInfo) line: not available > > RAMTransaction.openConglomerate(Conglomerate, boolean, int, > int, int, StaticCompiledOpenConglomInfo, DynamicCompiledOpenConglomInfo) > line: not available > > RAMTransaction.openConglomerate(long, boolean, int, int, > int) line: not available > > B2I.lockTable(TransactionManager, int, int, int) line: not > available > > BTreePostCommit.performWork(ContextManager) line: not > available > > BasicDaemon.serviceClient(ServiceRecord) line: not > available > > BasicDaemon.work(boolean) line: not available > > BasicDaemon.run() line: not available > > Thread.run() line: not available >