JS_NewRuntime failures
-
evan2m
- Milestone order changed from 0 to 0
Anyone have ideas of how to workaround this problem? My long-running processes that create Runtime instances are dying with this error.
I don't see anyway to explicitly free Runtime instances or share them between contexts.
Paul's idea to privately manage the Runtime from within the class sounds like the right approach since there is no public API for Runtime anyway (except new_context).
My context wrapper class works like this:
def __init__(self): """ Create a JS context and add in our functions """ rt = Runtime() self.ctx = rt.new_context()And errors on the rt = Runtime() line.
-
Paul J. Davis
Beyond sharing one runtime for the entire process there's not much I ever figured out on this. I'm not entirely certain on the best route other than to make the Runtime a process global.
To free a runtime you just need to let it get garbage collected like any other python object.
-
evan2m
Thanks for the quick reply.
I was able to workaround the problem by instantiating the Runtime at the module level rather than creating one for every instance of my wrapper class.
-
Chris
I would be very interested in a python-spidermonkey version with Runtime as a process global. I'm using web2py which doesn't give direct thread control, so I have no way to figure out when the Runtime is garbage collected.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.