algorithmic modeling for Rhino
Same happens to me (64 bit, 8GB of RAM)
My PC :XEON E3 1230v2 64bit 8GB
Rhino 5 and Grasshopper 090072
Recursion -when naively implemented- requires more and more memory space to keep the function call stack. Function stack space is very limited and quickly runs out. When it does, you crash.
--
David Rutten
david@mcneel.com
Can I set the RAM limitation manually to solve that problem?Is there a setting about RAM in Grasshopper090072?
It's not about how much memory you have left on RAM, it's about how much memory is allotted for the call stack, which is not something you can control. I don't know for sure but it's probably hard-coded.
--
David Rutten
david@mcneel.com
Would freezing the thread for some time help ?
No. It will delay the inevitable, but nothing else.
Seriously, there's no decent solution without redesigning the algorithm. Using recursion by having a function call itself over and over will crash the computer sooner or later. This is why there are often iterative and tail-recursive alternatives to naive-recursive functions.
The recursion depth should be in the hundreds of nested layers though, if you're running into this limitation, are you sure your algorithm is not stuck? It seems like you'd rarely need to go that deep.
--
David Rutten
david@mcneel.com
Using OOP instead finally solve my problem.Maybe recursive is not suitable for large inputs.
You can still fake the recursive process! Copy the same function with a different name and call the new function (which is actually the same function) at the end of your function. It will let the system to reset the memory each time for the function so it won't crash.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by