public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [Bitcoin-development] BitcoinQt eating 100% CPU
@ 2012-02-21 20:33 Michael Grønager
  2012-02-23 20:02 ` Michael Gronager
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Grønager @ 2012-02-21 20:33 UTC (permalink / raw)
  To: Bitcoin Dev

Hi Wladimir / others,

I just downloaded the latest (0.6 rc1) source of bitcoin-qt and built it using qt-creator on MacOSX 10.7.3. Nice and easy experience, even though I had to change BDB version to 5.1 ;)

However, when running it, it is using 100% CPU (after initial block chain download that is...)
* All activity in debug.log seems normal (blocks/txes/addresses are processes and accepted etc) so it is not stuck (at least not in the MessageThread)
* Sampling the process shows that the majority of time in each thread is used for:
** __semwait_signal
** kevent
** __select
** mach_msg_trap
** boost::date_time::micro_sec_clock

None of this would usually alert me - sleeping and waiting for conditions should not consume CPU, the only issue seems to be the last line which is called from qtipcserver.cpp line 31:

       if(mq->timed_receive(&strBuf, sizeof(strBuf), nSize, nPriority, d))

As I see it this should not consume cpu either, but, it is the only thing that seems a bit strange..

Have you seen this before?

/M


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bitcoin-development] BitcoinQt eating 100% CPU
  2012-02-21 20:33 [Bitcoin-development] BitcoinQt eating 100% CPU Michael Grønager
@ 2012-02-23 20:02 ` Michael Gronager
  2012-02-23 20:26   ` Gavin Andresen
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Gronager @ 2012-02-23 20:02 UTC (permalink / raw)
  To: Bitcoin Dev

A follow up on my mail from the other day (got it send from the wrong email address...)

I now exit the ipc thread at startup by inserting:

void ipcThread(void* parg)
{
   ipcShutdown();
   return;

Bitcoin-Qt is now running nicely using around 0.9% CPU. So it seems like the culprit was indeed line 31:

if(mq->timed_receive(&strBuf, sizeof(strBuf), nSize, nPriority, d))

Others, who have seen similar issues ?

Cheers,

M 

On 21/02/2012, at 21:33, Michael Grønager wrote:

> Hi Wladimir / others,
> 
> I just downloaded the latest (0.6 rc1) source of bitcoin-qt and built it using qt-creator on MacOSX 10.7.3. Nice and easy experience, even though I had to change BDB version to 5.1 ;)
> 
> However, when running it, it is using 100% CPU (after initial block chain download that is...)
> * All activity in debug.log seems normal (blocks/txes/addresses are processes and accepted etc) so it is not stuck (at least not in the MessageThread)
> * Sampling the process shows that the majority of time in each thread is used for:
> ** __semwait_signal
> ** kevent
> ** __select
> ** mach_msg_trap
> ** boost::date_time::micro_sec_clock
> 
> None of this would usually alert me - sleeping and waiting for conditions should not consume CPU, the only issue seems to be the last line which is called from qtipcserver.cpp line 31:
> 
>      if(mq->timed_receive(&strBuf, sizeof(strBuf), nSize, nPriority, d))
> 
> As I see it this should not consume cpu either, but, it is the only thing that seems a bit strange..
> 
> Have you seen this before?
> 
> /M




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bitcoin-development] BitcoinQt eating 100% CPU
  2012-02-23 20:02 ` Michael Gronager
@ 2012-02-23 20:26   ` Gavin Andresen
  2012-02-23 20:33     ` Luke-Jr
  0 siblings, 1 reply; 4+ messages in thread
From: Gavin Andresen @ 2012-02-23 20:26 UTC (permalink / raw)
  To: Michael Gronager; +Cc: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

Bitcoin-Qt is now running nicely using around 0.9% CPU. So it seems like
> the culprit was indeed line 31:
>
> if(mq->timed_receive(&strBuf, sizeof(strBuf), nSize, nPriority, d))
>
> Others, who have seen similar issues ?
>
>
I can definitely reproduce the issue on my mac.

If I recall correctly, the Mac Bitcoin-Qt does not register itself as a
bitcoin: URL handler, so the easiest fix for the 0.6 release would be to
just never launch the ipcThread #ifdef Q_WS_MAC


-- 
--
Gavin Andresen

[-- Attachment #2: Type: text/html, Size: 786 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Bitcoin-development] BitcoinQt eating 100% CPU
  2012-02-23 20:26   ` Gavin Andresen
@ 2012-02-23 20:33     ` Luke-Jr
  0 siblings, 0 replies; 4+ messages in thread
From: Luke-Jr @ 2012-02-23 20:33 UTC (permalink / raw)
  To: bitcoin-development

On Thursday, February 23, 2012 3:26:40 PM Gavin Andresen wrote:
> If I recall correctly, the Mac Bitcoin-Qt does not register itself as a
> bitcoin: URL handler, so the easiest fix for the 0.6 release would be to
> just never launch the ipcThread #ifdef Q_WS_MAC

Wouldn't that prevent the user from registering it?



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-23 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-21 20:33 [Bitcoin-development] BitcoinQt eating 100% CPU Michael Grønager
2012-02-23 20:02 ` Michael Gronager
2012-02-23 20:26   ` Gavin Andresen
2012-02-23 20:33     ` Luke-Jr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox