Taritsyn / JavaScriptEngineSwitcher

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines. This library allows you to quickly and easily switch to using of another JavaScript engine.
Apache License 2.0
440 stars 49 forks source link

JavaScriptEngineSwitcher.V8.Native.win-x64 v2.4.13 - Could not load file or assembly ClearScript version 5.4.10.0 #47

Closed VladimirLevchuk closed 6 years ago

VladimirLevchuk commented 6 years ago

Hi Andrey,

after installing JavaScriptEngineSwitcher.V8.Native.win-x64 v2.4.13 to my project (target framework 4.6.2) I got an error "Could not load file or assembly ClearScript version 5.4.10.0, The located assembly manifest doesn't match the assembly version". The packaged $packages\JavaScriptEngineSwitcher.V8.2.4.10\lib\net45\ClearScript.dll has version 5.4.9.0, so I worked it around adding assembly binding. `

            <bindingRedirect oldVersion="0.0.0.0-5.4.10.0" newVersion="5.4.9.0" />
        </dependentAssembly>`

My main goal is to avoid memory leak issue (https://github.com/reactjs/React.NET/issues/343) which is present (according to my local tests) for v2.4.12 of this library.

P.S. I don't use ClearScript.V8 package :)

Taritsyn commented 6 years ago

Hello, Vladimir!

The packaged $packages\JavaScriptEngineSwitcher.V8.2.4.10\lib\net45\ClearScript.dll has version 5.4.9.0, so I worked it around adding assembly binding.

You upgraded the JavaScriptEngineSwitcher.V8 package to version 2.4.13? If upgraded, then read the following discussion.

Taritsyn commented 6 years ago

You have incompatible versions of packages with managed (JavaScriptEngineSwitcher.V8 version 2.4.10) and native (JavaScriptEngineSwitcher.V8.Native.win-x64 version 2.4.13) assemblies. Just need to upgrade the JavaScriptEngineSwitcher.V8 package to version 2.4.13.

VladimirLevchuk commented 6 years ago

Thanks for a quick response. Updating JavaScriptEngineSwitcher.V8 to v2.4.13 (and manually updating assembly binding for JavaScriptEngineSwitcher.V8) solved the problem!

Taritsyn commented 6 years ago

About memory leaks: I know a few highload portals, that use a configuration similar to yours and not have memory leak issues. You should to watch the following video.

VladimirLevchuk commented 6 years ago

Thank you, it was useful. Probably leaks I see are connected with js garbage collection, I'll play with https://github.com/DaniilSokolyuk/ReactJsDotNetMeetup/tree/master/JsPoolOptimization and get back to you.

Taritsyn commented 6 years ago

Thank you, it was useful. Probably leaks I see are connected with js garbage collection, …

This is not a leaks, but a slowdown caused by thread locking during garbage collection. By the way, in version 2.4.13 I removed unnecessary locks.

… I'll play with https://github.com/DaniilSokolyuk/ReactJsDotNetMeetup/tree/master/JsPoolOptimization and get back to you.

I think, that this will allow you to increase the speed of page rendering.