Open GoogleCodeExporter opened 9 years ago
This one would be more correct example
for i in xrange(10**5):
with PyV8.JSContext() as ctx:
ctx.eval(js_code)
if i % 10000:
PyV8.JSEngine.collect()
gc.collect()
print get_mem()
Original comment by alexan...@bekbulatov.ru
on 9 Apr 2014 at 1:22
1. Test 1: Eval empty string
js_code = ''
(741580, 16600)
...
(741580, 16600)
Looks ok!
2. Test 2: Eval small js code
js_code = 'function hello(name) { return "Hello " + name + " from Javascript";
}'
(741576, 16596)
(741580, 16636)
(741580, 16644)
...
(747648, 22080)
Then I stopped. It leaks but not so much
3. Test 3: Eval 300Kb js file
js_code = open('bem/touch.bundles/rubric/rubric.xml.js',
'r').read().decode('utf-8')
(744060, 20436)
(745880, 21796)
(746904, 22272)
...
(1148336, 311196)
(1148336, 311556)
This is huge leak. Test finished with
PyV8.JSError: JSError: <CALL_AND_RETRY_LAST> Allocation failed - process out of
memory
Thank you in advance for any help.
Original comment by alexan...@bekbulatov.ru
on 10 Apr 2014 at 6:40
I think the workaround posted in my issue might help you as well, see today's
update: https://code.google.com/p/pyv8/issues/detail?id=229
Original comment by mmueller...@gmail.com
on 4 May 2014 at 11:55
Original issue reported on code.google.com by
alexan...@bekbulatov.ru
on 9 Apr 2014 at 12:48