By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,824 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,824 IT Pros & Developers. It's quick & easy.

Thread Profiling

P: n/a
Are there any good thread profilers available that can profile a
thread as it is running instead of after execution is completed?

I would like to find a python class which looks at a currently running
thread and if its memory exceeds a certain amount than kill it.
Ideally I would like the program to track memory used not just by that
thread, but by any threads or processes that it may spawn.

If there isn't anything like that, then something that lets me set the
maximum memory allowed to be allocated within a thread would be
acceptable also.

Thanks in advance,
James Howard

Nov 5 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Nov 5, 2007 1:32 PM, JamesHoward <Ja************@gmail.comwrote:
Are there any good thread profilers available that can profile a
thread as it is running instead of after execution is completed?

I would like to find a python class which looks at a currently running
thread and if its memory exceeds a certain amount than kill it.
Killing a non-cooperative thread is undefined behavior. You can't do
it with the Python threading API and even OS thread implementations
that permit it don't guarantee that your process will be in a sane
state afterward.
Ideally I would like the program to track memory used not just by that
thread, but by any threads or processes that it may spawn.

If there isn't anything like that, then something that lets me set the
maximum memory allowed to be allocated within a thread would be
acceptable also.
Memory isn't allocated on a per-thread basis and there's not really
any way to know what should be charged to a particular thread. That's
on top of the normal caveats about trying to judge memory usage within
Python

Thanks in advance,
James Howard

--
http://mail.python.org/mailman/listinfo/python-list
Nov 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.