Hi Praveen,
Be sure to dispose each instance of
In addition, be careful with the number of active (undisposed) instances you have at a time. Each V8 runtime reserves a large chunk of address space, and a 32-bit process can easily reach the point of exhaustion with just a few dozen instances. For concurrent execution of multiple scripts, consider using a pool of engines, with a fixed size that's roughly equal to your CPU core count.
Good luck!
Be sure to dispose each instance of
V8ScriptEngine
when you're done with it. That's absolutely essential in an application that uses multiple instances, as each one holds significant unmanaged resources that .NET's garbage collector can't track.In addition, be careful with the number of active (undisposed) instances you have at a time. Each V8 runtime reserves a large chunk of address space, and a 32-bit process can easily reach the point of exhaustion with just a few dozen instances. For concurrent execution of multiple scripts, consider using a pool of engines, with a fixed size that's roughly equal to your CPU core count.
Good luck!