RoamUniverse / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

Memory leak while calling a function #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Memory usage constantly increases while calling same function again and 
again by the size of passed arguments (i am passing an array of 1000 
elements for example). Without any arguments there are small leak (about 500 
bytes) too.

Original issue reported on code.google.com by gauss...@gmail.com on 7 Apr 2010 at 5:53

Attachments:

GoogleCodeExporter commented 9 years ago
fresh Ubuntu Lucid x86_64, PyV8 SVN r250, V8 SVN r4358. 
Also leaks on JS ({ 'test': 'ahjklehjfklwefewmfpw' }) while getting 'test' 
attribute 
value.

Original comment by gauss...@gmail.com on 7 Apr 2010 at 6:22

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 8 Apr 2010 at 2:00

GoogleCodeExporter commented 9 years ago
It seems leaking memory when wrap python object as v8 javascript handle. I will 
analyze it more deeper later.

Original comment by flier...@gmail.com on 8 Apr 2010 at 3:32

GoogleCodeExporter commented 9 years ago
The root cause is pyv8 forget to dispose internal object of function params. On 
the 
other hand, I add a JSEngine.collect method to force v8 GC.

Please verify the issue with SVN code after r251, thanks

Original comment by flier...@gmail.com on 8 Apr 2010 at 4:34

GoogleCodeExporter commented 9 years ago
I have changed the strategy to trace Python object in v8 with WeakReference, 
please 
verify the issue with SVN code after r253.

Thanks for your suggestion :)

Original comment by flier...@gmail.com on 10 Apr 2010 at 5:37

GoogleCodeExporter commented 9 years ago
r253 works nice in test environment (function called 1000 times with arguments 
(range(10000)) - about 62M ram used without leak) , but have some issues. 
Django 
aborts at random moments with symbolless(?!) coredump even v8 and pyv8 compiled 
with 
debug enabled. I am tracking down this problem now. Looks like it's double-free 
problem but I doesn't created testcase for it... yet ;)

Original comment by gauss...@gmail.com on 10 Apr 2010 at 8:14

GoogleCodeExporter commented 9 years ago
It seems pyv8 made a mistake to decrease reference count too early, please 
verify it 
with SVN code after r254

Original comment by flier...@gmail.com on 11 Apr 2010 at 12:19