Status: Untriaged
Owner: ----
New issue 4281 by [email protected]: Memory leak isolate new
https://code.google.com/p/v8/issues/detail?id=4281
Version: nodejs 12.04
OS: Ubuntu 14.10
Architecture: x64
I watch the memory is up to much.
It is my test code:
hello.cc
============================================================
#include <node.h>
#include <string>
using namespace v8;
void Method(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = Isolate::GetCurrent();
HandleScope handle_scope(isolate);
Handle<Context> context = Context::New(isolate);
Persistent<Context> persistent_context(isolate, context);
Context::Scope context_scope(context);
Handle<String> source = String::NewFromUtf8(isolate,"1==1");
Handle<Script> script = Script::Compile(source);
Handle<Value> result = script->Run();
args.GetReturnValue().Set(result);
}
void init(Handle<Object> exports) {
NODE_SET_METHOD(exports, "hello", Method);
}
NODE_MODULE(addon, init);
app.js
=================================================================
var addon = require('./build/Release/hello');
while (true){
console.log(addon.hello());
console.log(parseInt(process.memoryUsage().heapTotal/1024/1024));
}
When I run addon.hello(), I get memory increase by 1 Мб for each iteration.
Is it bug v8 or my mistake in code?
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.