Extracting results from a large hotshot profile

Brian Cole brianc at temple.edu
Mon Jan 16 12:51:38 EST 2006

Tried replacing sys.getrecursionlimit() with 40,000. Choked with the
same error, just took longer to get there.

It looks like depth is not reset to zero after the yield:
if (not i%yieldCount) and i:
    yield i, files, functions

Should it be?

On 1/16/06, Mike C. Fletcher <mcfletch at vrplumber.com> wrote:
> Brian Cole wrote:
> >Thanks for the tip. I got the following error message when trying to
> >run your profiler.
> >
> >
> ...
> >  File "c:\Documents and Settings\coleb2\My Documents\software\Python24\Lib\site
> >-packages\runsnakerun\hotshotreader.py", line 95, in loadHotshot
> >    localDeltas[depth] = 0
> >IndexError: index out of bounds
> >
> >
> ...
> >As the traceback shows I'm running this on Windows. I'm gonna go
> >wrestle with installing wxPython and Numeric on my Linux box and see
> >if that makes a difference.
> >
> >
> Not likely.  The hotshotreader module is creating an array of
> sys.getrecursionlimit() long integers to store the accumulated local
> times.  It does the same to track the number of frames.  Most likely
> your main program is setting sys.getrecursionlimit explicitly and as a
> result it winds up with a larger possible stack.  You can try replacing
> the sys.getrecursionlimit() calls with some big number (say 40,000, or
> just multiply the recursion limit by 10 or 20 if you like) and see if
> that solves the problem.  Probably should allow for setting the value on
> the command-line I guess.  I suppose there may also be cases where a
> recursive call to the interpreter gets a whole separate stack... or
> maybe there's something going on with threads intermixing to create
> greater depth.
> Let me know if that helps,
> Mike
> --
> ________________________________________________
>   Mike C. Fletcher
>   Designer, VR Plumber, Coder
>   http://www.vrplumber.com
>   http://blog.vrplumber.com

More information about the Python-list mailing list