Subject: | Memory leak in V8Context: make_function and string_wrap unreleased |
Adding these two lines to ~V8Context:
make_function.Dispose();
string_wrap.Dispose();
seems to keep memory usage stable under this kind of testing loop:
for (1 .. 10000) {
my $v8 = JavaScript::V8::Context->new();
print grep /VmRSS/, `cat /proc/$$/status`;
}
testing code is obviously Linux only. Without this change, every V8Context leaks about 100 kB, and the total lossage will be around 1 GB, so the signal is clear enough.