Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Increasing memory during V8 usage

0
0
Hi,

i have a memory problem and i don't know if it is due to a wrong usage or a problem in the engine.
When I use the V8 engine a long time with many JS-calls from C#:
using (var compiledFunction = m_Engine.Compile(function))
{
    var result = m_Engine.Evaluate(compiledFunction);
    Log.Debug("Result of function '" + function + "': " + result);
}

(also tried: engine.Execute(function);)
and many calls from JS to C# through an object I attached to engine.Script
engine.Script["nameOfObject"] = theObject;

(also tried: engine.AddHostObject("nameOfObject", theObject);)
the memory usage is increasing constantly.
I used DebugDiag2 to see what could cause that problem. Most of the memory is allocated by v8_x64.dll
Module Name   v8_x64 
Allocation Count   466 allocation(s) 
Allocation Size   1.02 GBytes 

---

Function details

Function   v8_x64!v8::Testing::DeoptimizeAll+109ccd 
Source Line    
Allocation type   Virtual memory allocation(s) 
Allocation Count   460 allocation(s) 
Allocation Size   530.3 MBytes 
Leak Probability   84% 
and here is a call stack sample
Call stack sample 3

Address   0x00000000`22000000 
Allocation Time   14:43:09 since tracking started 
Allocation Size   8.02 MBytes 

LeakTrack+229ef    
v8_x64!v8::Testing::DeoptimizeAll+109ccd    
v8_x64!v8::Testing::DeoptimizeAll+c6037    
v8_x64!v8::Testing::DeoptimizeAll+c65b7    
v8_x64!v8::Testing::DeoptimizeAll+c9eb8    
v8_x64!v8::Testing::DeoptimizeAll+248ff    
v8_x64!v8::Testing::DeoptimizeAll+88b5c    
v8_x64!v8::Testing::DeoptimizeAll+52fd8    
v8_x64!v8::Testing::DeoptimizeAll+53324    
v8_x64!v8::Testing::DeoptimizeAll+4ef50    
v8_x64!v8::Testing::DeoptimizeAll+1337c4    
v8_x64!v8::Testing::DeoptimizeAll+133a30    
v8_x64!v8::Testing::DeoptimizeAll+111885    
v8_x64!v8::Script::New+236    
v8_x64!v8::Script::New+31    
ClearScriptV8_64+5a8e    
0x7FE916BF3C1 
Do you see something what I am doing wrong or do you have some hints what else I can try?

Viewing all articles
Browse latest Browse all 2297