Status: New
Owner: ----
New issue 2755 by [email protected]: memory leak in isolate new
http://code.google.com/p/v8/issues/detail?id=2755
may be memory leak in isolate new, this is my test code.
I watch the memory is up to much. I think the issue is not fixed.
while(true)
{
v8::Isolate* isolate = v8::Isolate::New();
{
v8::Isolate::Scope iscope(isolate);
v8::V8::Initialize();
v8::Locker l(isolate);
HandleScope handle_scope;
Persistent<Context> context = Context::New();
if(context.IsEmpty())
{
LOG_FATAL("get context error");
return 0;
}
Context::Scope context_scope(context);
v8::TryCatch try_catch;
//myc
Handle<FunctionTemplate> myc =
FunctionTemplate::New(JSConstructor);
myc->SetClassName(String::New("CActiveXObject"));
Handle<ObjectTemplate> inst = myc->InstanceTemplate();
inst->SetInternalFieldCount(1);
context->Global()->Set(String::New("CActiveXObject"),
myc->GetFunction());
Handle<FunctionTemplate> myc1 = FunctionTemplate::New();
myc1->SetClassName(String::New("ExploreBase"));
Handle<ObjectTemplate> proto =
myc1->PrototypeTemplate();
proto->Set("CallBack",FunctionTemplate::New(CallBack));
context->Global()->Set(String::New("ExploreBase"),
myc->GetFunction());
string strJsCon = load_js();
Handle<String> js = String::New(strJsCon.c_str(),
strJsCon.length());
Handle<Script> script = Script::Compile(js);
if (script.IsEmpty())
{
std::cout << "err complier js" << std::endl;
}
else
{
Handle<Value> result;
{
result = script->Run();
//alarm(0);
if (result.IsEmpty())
{
std::cout << "exception!!!" <<
std::endl;
}
}
HeapStatistics hs;
V8::GetHeapStatistics(&hs);
int endHeapSize = hs.used_heap_size();
std::cout << " used_heap_size: " <<
hs.used_heap_size()
<< " total_heap_size: " <<
hs.total_heap_size()
<< " total_physical_size: "
<< hs.total_physical_size()
<< std::endl;
}
context.Dispose();
}
isolate->Dispose();
}
--
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/groups/opt_out.