Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Script Memory Usage (and potentially execution time) #2

Open
robbiehudson opened this issue Oct 18, 2011 · 3 comments
Open

Comments

@robbiehudson
Copy link

It'd be great to be able to configure the amount of memory that can be used by a script.

I believe this is currently set using PHP_JSRUNTIME_GC_MEMORY_THRESHOLD. It'd be great to expose this through the context interface in PHP.

Also, would it be possible to implement a max execution time on a script? I looked at the Python SpiderMonkey source and it looks possible using callbacks. It's also exposed in a nice way through their API.

Thanks,

Rob

@beberlei
Copy link

+1

1 similar comment
@icellan
Copy link

icellan commented Jul 5, 2013

+1

@christopherobin
Copy link
Owner

I will add a way to change PHP_JSRUNTIME_GC_MEMORY_THRESHOLD through an ini value, but for the max execution time it cannot be done unless we revert the extension to an older spidemonkey version (pre-JIT <1.8.1). What the python extension does is use that older version and implements the branch callback that is called everytime the code branch. It was removed by Mozilla in favor of another API, but using this API means creating threads to monitor the execution, which is clearly not recommended in a PHP extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants