Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPython kernel cpu usage increases with time #1450

Closed
spyder-bot opened this issue Feb 17, 2015 · 13 comments
Closed

IPython kernel cpu usage increases with time #1450

spyder-bot opened this issue Feb 17, 2015 · 13 comments

Comments

@spyder-bot
Copy link
Collaborator

From mrcl...@gmail.com on 2013-06-19T13:13:13Z

Spyder Version: 2.2.0
Python Version: 2.7.5
Qt Version: 4.8.4, PyQt4 (API v2) 4.10.1 on Darwin

What steps will reproduce the problem?

  1. Start Spyder (from terminal or standalone application)
    1. Open an IPython console (I have this set to open automatically at startup)
    2. Wait... What is the expected output? What do you see instead? Without running any code whatsoever, I expect the cpu resources to remain the same. Instead, I see ever increasing consumption of cpu resources. Up to 110% (dual core) after 5 days. Although as much as 10% is observed after only one day. This only seems to occur for IPython within Spyder; IPython started from the terminal does not have this issue.

Please provide any additional information below

. Screen shot of Activity monitor is attached.
Using IPython 0.13.2, via MacPorts
Using Spyder 2.2.0, via MacPorts
Using Spyder 2.2.0, standalone application
Preferences: IPython Console: Graphics: Activate Support = True, Backend = Automatic.
Preferences: IPython Console: Startup: Open an IPython console at startup = True

Attachment: Screen Shot 2013-06-17 at 8.25.31 AM.png

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1450

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-06-29T09:29:43Z

Thanks for reporting, I've noticed this behavior as well, it's really annoying.

I'll try to look into it for our next release.

Status: Accepted
Labels: -Priority-Medium Priority-Critical MS-v2.3 Cat-IPythonConsole

@spyder-bot
Copy link
Collaborator Author

From bckr...@gmail.com on 2013-09-18T06:18:55Z

Similar experience here.

i cannot comment on the slow increase in CPU usage, but i experience general high CPU usage for an idling Spyder session on Mac OS 10.8.4 . Roughly every 10 sec, CPU spikes up to 50% on a 2.4 GHz Core 2 Duo iMac.
Also, the UI is generally sluggish with a 2 sec. waiting period for each switch of focus between editor, IPython console or Object Inspector.
this is without anything running, but a few matplotlib windows open in the background.

@spyder-bot
Copy link
Collaborator Author

From bckr...@gmail.com on 2013-09-18T06:20:56Z

p.s., Python 2.7.5 64bits, Qt 4.7.4, PySide 1.1.2 on Darwin

@spyder-bot
Copy link
Collaborator Author

From bckr...@gmail.com on 2013-09-18T06:30:28Z

ok, i have narrowed down the culprit:

none of the slowness occurs when the variable explorer is hidden. unfortunately, disabling the variable auto-update did not help to resolve the sluggishness on focus change.

should i open a new bug?

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-09-18T08:38:26Z

Thanks a lot for narrowing down the problem. I was suspecting the cause was something like that. Unfortunately that means the bug is rooted in our core architecture, which will make it much harder to solve.

Does this happen without evaluating a single line of code in the console? Or after you've evaluated expressions with big numpy arrays on it?

@spyder-bot
Copy link
Collaborator Author

From mrcl...@gmail.com on 2013-09-18T11:14:43Z

When I performed the original experiment to file the issue, no code was run after console startups. No scripts were run or data loaded into memory. Just starting the applications, that is all. For the Spyder applications, I have a default window configuration which was used. This configuration does have the Variable Explorer available in one pane, but not visible (see attached pic).

Attachment: Screen Shot 2013-09-18 at 11.04.52 AM.png

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-09-19T21:18:05Z

What are your IPython versions, please?

@spyder-bot
Copy link
Collaborator Author

From caleb.ha...@gmail.com on 2013-09-19T21:32:27Z

Ipython commit bc6128a (i.o.w. current HEAD of master). I confirmed the issue in Spyder again this morning.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-09-19T21:40:22Z

Thanks! That's what I'm seeing too, i.e. the problem seems to appear only on 1.0+.

Could you checkout 0.13.2 in your repo, install it and tell me if you see the problem there too?

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-09-20T11:15:09Z

I think I found the culprit: it's the auto-refresh feature of our Variable Explorer. Please help me to test it by doing this:

  1. Select The Variable Explorer tab.
    2, Deactivate auto-refresh by pressing the button I'm showing in the attached image. Then CPU usage should between 0 to 2%.

This solved the issue completely for me.

Labels: -MS-v2.3 MS-v2.2.5

Attachment: autorefresh button.png

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-09-21T13:59:52Z

This issue was updated by revision fd58c2493c27 .

  • When auto_refresh_button was active, our IPython kernels consumed more and
    more CPU during time in a dramatic way! After just three hours of being idle,
    they were using about 30% of CPU.
  • This has an important side effect: now we are forced to refresh the Variable
    Explorer after each cell execution (but that's probably what most people
    intuitively expect).

Status: Started

@spyder-bot
Copy link
Collaborator Author

From mrcl...@gmail.com on 2013-09-23T12:33:28Z

I can also confirm that disabling the auto refresh button in the variable explorer appears to remedy the symptoms. Spyder = 1.7%; iPython kernal = 0.3% for both terminal started and standalone apps after ~2.5 days of idle runtime.

The auto-refresh button seems to be engaged upon startup, regardless of the previous state. I don't use the Variable Explorer, so I will try removing it from my window layout as a workaround for now.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-09-26T11:25:55Z

Ok, thanks a lot for the confirmation. The revision mentioned in comment #11 not only unchecked but also disabled the auto-refresh button for all our IPython consoles (so that users can't check it even if they want to).

Sorry for taking so much time to fix it, this problem was really serious!

Status: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant