todbot / Blink1Control2

Blink1Control GUI to control blink(1) USB RGB LED devices.
http://blink1.thingm.com/
Apache License 2.0
154 stars 26 forks source link

CPU usage grows over time #60

Open robeden opened 6 years ago

robeden commented 6 years ago

After a period of time, the application (both "Blink1Control2" and "Blink1Control2 Helper") CPU utilization grows so that they're using about a quarter of my CPU (on each core) in "waves". (See this screen capture of the Activity Viewer at 1 second sample rate)

I'm not sure how long it takes to get into this state, but a restart will reduce that pattern for some amount of time (with "waves" cresting at about 3% for the parent process).

Here are samples of the processes: Sample of Blink1Control2.txt Sample of Blink1Control2 Helper.txt

System/app version info:

Process:         Blink1Control2 [17482]
Path:            /Applications/Blink1Control2.app/Contents/MacOS/Blink1Control2
Identifier:      com.thingm.blink1control2
Version:         2.0.0-beta4 (2.0.0-beta4.36)
Code Type:       X86-64

Date/Time:       2017-09-18 13:00:28.947 -0500
Launch Time:     2017-09-12 17:35:26.513 -0500
OS Version:      Mac OS X 10.12.6 (16G29)
robeden commented 6 years ago

After filing this bug I noticed 2.0.2 was out so I updated and have been running that. Sometime during that time (about 3 hours) it started exhibiting the same behavior.

todbot commented 6 years ago

Hi, Thanks for the detailed log. A few questions:

  1. What event sources do you have configured?
  2. Is this with the blink(1) plugged in or without it plugged in?
  3. Do you have anything on your USB that is causing your system to rescan the USB bus? (this is hard to answer, but more like: do you have anything "weird" hooked up to via USB?)
robeden commented 6 years ago
  1. Looks like just the default ones (which I hadn't realized were there 😄 )

    screen shot 2017-09-19 at 10 48 12 am
  2. It's plugged in (and I have only one)

  3. I don't think there's anything strange. Here's a shot of the bus tree:

    screen shot 2017-09-19 at 11 00 38 am

    The "Ultra Fit" is a drive (from SanDisk). Otherwise, there's a keyboard, wireless mouse and all the built-in stuff associated with an iMac. The only unusual things I can think of are that the (Logitech) wireless mouse receiver and the blink(1) are on extenders which could mess up timings, I suppose. The extender cable for the mouse receiver is about 2 foot long. The blink(1) is attached to the flexible arm-thingy (approx. 1ft), which is connected to a cable extender, approximately 3 or 4 foot long.

robeden commented 6 years ago

Looks like just the default ones

Oooh... removing those immediately made the CPU usage drop. Looks like they may be the culprits.

adamrhoades commented 6 years ago

I've been having a similar problem, the CPU usage jumps massively, the LED blinks out the last command it received repeatedly without end.

The software will respond to button presses, but as soon as you stop a pattern, or set the Blink(1) to 'Off'... the last command repeats and it starts flashing again. The only way to stop it is to quit the app.

I'm triggering events exclusively with webhook calls, IFTTT is configured, but not being used. Its always the same webhook call that show in the log, nothing else.

Blink(1)Control 2.02 MacOS Sierra 10.12.6

I've removed the wireless Keyboard receiver, leaving only a Powered USB Hub with the Blink(1) and a Hard drive plugged directly into the mac... this hasn't helped at all.

Any advice at all please?

scrolls-mckenzie commented 6 years ago

I'm seeing similar behavior. If I make the pattern scripts loop and it receives another trigger it wont stop. The program also seems to hang several times a day and I have to force quit.

I'm on High Sierra

todbot commented 6 years ago

Hi, Next time this happens, could you try doing "Toggle DevTools" from the Blink1Control2 menu and seeing what messages are being displayed. This opens up a console similar to what's in browser and should show any error messages if they are happening. The window when open will look like similar to this: screen shot 2017-11-27 at 10 24 31a

scrolls-mckenzie commented 6 years ago

Hi Todbot,

Thanks for the prompt reply. It's always great to see the dev taking a keen interest in how the product is tracking

I've had the console view open all day and have not seen any errors or warnings. I have had to restart it several times and now it is acting very slugish. It is taking a few seconds to register button clicks. Please let me know if there are any logs or further details to help in debugging.

scrolls-mckenzie commented 6 years ago

Furthermore, it has now started to use over 65% CPU constantly and has become almost unresponsive. The console, even in verbose, shows absolutely nothing. Both the app and the helper are running high CPU. This is the sort of behavior that I have seen before. The longer the app runs, the higher likely hood of failure.

screen shot 2017-11-28 at 4 56 40 pm

scrolls-mckenzie commented 6 years ago

Sorry to post multiple times but I am trying to show all the symptoms that present. After trying to quit the app several times, the console started to show something again

screen shot 2017-11-28 at 4 59 55 pm
todbot commented 6 years ago

I think I've recreated what you're seeing on one of my computers. I'm now looking into what could be causing this. Thanks for submitting this issue.

todbot commented 6 years ago

I think this is also part of the problem with issue #22

scrolls-mckenzie commented 6 years ago

Hi there,

I installed your latest pre-release build and am still having faults. Still the issue is the app hanging on commands and becoming unresponsive. It has been running for about 1 hour and received the first notification that i have received an email and hung on the command and did not turn off. I tried to then open the controls to see what was happening but the app had hung and I could not open the controls at all. I had to force quit to regain control.

The mail server that it hung on was an exchange email account. This is the same behavior as previous. I have not seen a CPU spike yet but I will keep an eye out

todbot commented 6 years ago

Hi @scrolls-mckenzie, Could you try running the app without the blink(1) device plugged in and see if you still see the issues you're experiencing?

scrolls-mckenzie commented 6 years ago

Hey todbot,

Just getting back to you about running it without the blink attached. It has crashed again and all I could do was force quit. This is without the blink attached for a few days.

Same same unfortunately

scrolls-mckenzie commented 6 years ago

Still the same. I force quit the app daily to get it to work...

on 2.0.4

todbot commented 6 years ago

Hi @scrolls-mckenzie, Was this on a recent release? The latest is v2.0.5.

scrolls-mckenzie commented 6 years ago

Hi todbot.

I checked if there was an update 3 days ago and was a touch early. I have now downloaded 2.0.5 and will let you know

scrolls-mckenzie commented 6 years ago

Still crashing. I only have 2 email event sources from exchange. i'm on version 2.1.0