I am using python 2.7.2 on mac os 10.7.3
I am executing a recursive algorithm in python with over 50,000 recursion levels.
I tried to increase the maximum recursion level to 1,000,000, but my python shell still exits after 18,000 recursion levels.
I tried to increase available resources:
import resource resource.setrlimit(resource.RLIMIT_STACK, (2**29,-1)) sys.setrecursionlimit(10**6)
and I get this error:
Traceback (most recent call last): File "<pyshell#58>", line 1, in <module> resource.setrlimit(resource.RLIMIT_STACK,(2**29,-1)) ValueError: not allowed to raise maximum limit
I don’t know why I can’t increase the maximum limit?
Thanks for your suggestions.
Ricky bobby
source share