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

Echobot.py uses 100% CPU #65

Closed
tb0hdan opened this issue Oct 11, 2011 · 2 comments
Closed

Echobot.py uses 100% CPU #65

tb0hdan opened this issue Oct 11, 2011 · 2 comments

Comments

@tb0hdan
Copy link

tb0hdan commented Oct 11, 2011

Python: 2.7.1
Arch: x86_64
PyXMPP: latest from git

Debug shows tons of messages:

DEBUG:pyxmpp2.mainloop.base:About to call a timeout handler: <bound method Client.regular_tasks of <pyxmpp2.client.Client object at 0x1617990>>
DEBUG:pyxmpp2.expdict:expdict.expire. timeouts: {}
DEBUG:pyxmpp2.mainloop.base: handler result: 1
DEBUG:pyxmpp2.mainloop.base: auto-recurring, restarting in 1 s
DEBUG:pyxmpp2.mainloop.events: dispatching...
DEBUG:pyxmpp2.mainloop.events: queue empty
DEBUG:pyxmpp2.mainloop.base:About to call a timeout handler: <bound method Client.regular_tasks of <pyxmpp2.client.Client object at 0x1617990>>

@Jajcus
Copy link
Owner

Jajcus commented Oct 12, 2011

These messages are quite normal, but should be emitted once a second and that should not use 100% CPU, unless your system is really slow.
Do these messages appear more often? Is there anything more?
Try interrupting the script with Ctrl-C a few times – the stack dumps could show the place where it loops.

@tb0hdan
Copy link
Author

tb0hdan commented Oct 12, 2011

CPU: AMD Turion X2 1.8 GHz

Actually messages occur something like every 100ms.

Here's traceback:

DEBUG:pyxmpp2.mainloop.base:About to call a timeout handler: <bound method Client.regular_tasks of <pyxmpp2.client.Client object at 0x2d5b910>>
DEBUG:pyxmpp2.expdict:expdict.expire. timeouts: {}
DEBUG:pyxmpp2.mainloop.base: handler result: 1
DEBUG:pyxmpp2.mainloop.base: auto-recurring, restarting in 1 s
DEBUG:pyxmpp2.mainloop.events: dispatching...
DEBUG:pyxmpp2.mainloop.events: queue empty
^COUT: ''
DEBUG:pyxmpp2.transport:TCPTransport.disconnect()
OUT: '/stream:stream'
DEBUG:pyxmpp2.transport: _set_state('closing')
^CTraceback (most recent call last):
File "./echobot.py", line 119, in
main()
File "./echobot.py", line 116, in main
bot.disconnect()
File "./echobot.py", line 41, in disconnect
self.client.run(timeout = 2)
File "/mnt/storage/home/smtpror/PROJ/pyxmpp2/build/lib/pyxmpp2/client.py", line 216, in run
self.main_loop.loop(timeout)
File "/mnt/storage/home/smtpror/PROJ/pyxmpp2/build/lib/pyxmpp2/mainloop/base.py", line 90, in loop
self.loop_iteration(interval)
File "/mnt/storage/home/smtpror/PROJ/pyxmpp2/build/lib/pyxmpp2/mainloop/poll.py", line 123, in loop_iteration
next_timeout, sources_handled = self._call_timeout_handlers()
File "/mnt/storage/home/smtpror/PROJ/pyxmpp2/build/lib/pyxmpp2/mainloop/base.py", line 132, in _call_timeout_handlers
now = time.time()
KeyboardInterrupt

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

No branches or pull requests

2 participants