Skip to content

Conversation

@stesie
Copy link
Member

@stesie stesie commented Aug 27, 2015

If JavaScript code repeatedly calls a PHP method on an object exported to V8, v8js_named_property_callback currently generates a new v8::FunctionTemplate for each successive call. However those v8::FunctionTemplate objects are not subject to garbage collection, hence we leak memory on every method get ... which can become a problem quickly.

This patch adds FunctionTemplate caching quite like we already do for exported PHP objects themselves.

stesie added a commit that referenced this pull request Aug 27, 2015
Cache v8::FunctionTemplates created by v8js_named_property_callback
@stesie stesie merged commit 415b64c into phpv8:master Aug 27, 2015
@stesie stesie deleted the method-tmpl-cache branch August 27, 2015 13:29
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

Successfully merging this pull request may close these issues.

1 participant