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

New Post: Increasing memory during V8 usage

0
0
ClearScript wrote:
Hi again,

i can't check every script, that is executed by the users

If you're executing unknown or untrusted scripts, please note that a buggy or malicious script can easily corrupt the environment for subsequent scripts; e.g., by leaving data hanging off the root object, by altering built-in behavior with unexpected extensions, etc. If possible, consider creating a clean context for each script by re-instantiating V8ScriptEngine. If that's too expensive, you might be able to reuse one or more V8 runtimes (see V8Runtime.CreateScriptEngine()).

Cheers!
I'm already use such a solution. I have a "Runtime-Pool" (inspired by another thread here ;) ) with a specific number of runtimes and from there I create new V8ScriptEngines for every new script executer, so that I have a defined resource usage, but also a clean environment for every executor.

Now back to my problem. I tried the solution with the schedule of the Garbage Collection and it seems to work. The memory usage looks good now. I will still have a look at it, but I think the problem is resolved ;)

Thanks for your help...

Viewing all articles
Browse latest Browse all 2297