Skip to content

Conversation

@stesie
Copy link
Member

@stesie stesie commented Mar 25, 2016

Currently if you setMemoryLimit the timer thread regularly checks the size of the heap and compares it against the limit. If V8's old space is configured to be big (default is 1,5 GB) and a small limit is applied, it might happen that V8 does no garbage collection at all and V8Js considers the limit as hit.

This pull request changes the behaviour to first send a LowMemoryNotification to V8 in order to force a garbage collection run. If the heap size then is still too big, then execution is terminated.

Besides this adds a memory limit check after execution which triggers if execution times are small enough never to be hit by the timer threads 10ms interval.

This fixes #217

@stesie
Copy link
Member Author

stesie commented Mar 26, 2016

Latest tests just failed due to Github/Git errors. Rebuild succeeded: https://jenkins.brokenpipe.de/job/V8Js-PHP5.x/job/pull-req-builder/32/

@stesie stesie merged commit 1f54fac into phpv8:master Mar 26, 2016
@stesie stesie mentioned this pull request Mar 26, 2016
@stesie stesie deleted the issue-217 branch January 20, 2017 17:16
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