Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Current Stack Size
#1
In an application I am working on, users can traverse a graph. However, when they move on the graph, they are basically adding five function calls to the stack. Since the graph is connected, they could theoretically put enough function calls on the stack to run into the recursion limit. This is not something I expect to be likely. Traversing the graph is not the main function of the application, and it would be rather extreme to do it the 200 times it would take to hit the recursion limit (on my machine at least). But I have a feeling that someday, someone is going to try it, if only because they can.

Now, I know how to determine and change the recursion limit. It looks like the traceback module has way to explore the stack. But I couldn't find anything that just told me how big the stack was, or how close it was to the recursion limit. Does anyone know a simple way to get just that information? Or would I need to pull a summary of the whole stack using traceback and measure it myself?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#2
I have this post: https://python-forum.io/Thread-Walking-t...ight=stack
sorry, don't remember exactly how it works, but should be easy enough to figure out. It traverses the stack, so has to know what's in it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  size of set vs size of dict zweb 0 2,139 Oct-11-2019, 01:32 AM
Last Post: zweb
  CSV file created is huge in size. How to reduce the size? pramoddsrb 0 10,478 Apr-26-2018, 12:38 AM
Last Post: pramoddsrb

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020