Thread Profiling

J

JamesHoward

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
 
C

Chris Mellon

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top