-
Notifications
You must be signed in to change notification settings - Fork 49
JavaScriptEngineSwitcher.Core.JsRuntimeException: Out of memory. #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello, Ashkan! Most likely, reason for this error is that your web application is not enough memory. There are two ways to solve this problem:
|
In next release I will add the original exception as the inner exception. |
@Taritsyn Thanks for the fast reply. But if that is the case, why my IIS memory usage is growing all the time? |
Why did you decide, that the cause of memory leak is the JavaScriptEngineSwitcher.ChakraCore? Have you tried to use the JavaScriptEngineSwitcher.V8 instead of the JavaScriptEngineSwitcher.ChakraCore? |
This functionality is implemented in version 2.4.7. |
I've tried to install version 2.4.7 but as you know JSPool 2.0.1 is not compatible with JavaScriptEngineSwitcher 2.4 and adding ".AddChakraCore()" or "engineSwitcher.DefaultEngineName = ChakraCoreJsEngine.EngineName" didn't help so I'm cloning the "JSPool" and "React" project to see how far I can go with the tracing and testing. |
This feature is not supported by current version of the React.NET (read discussion).
Just need to configure the JavaScript Engine Switcher before registration of the React.NET (see Daniel's comment). |
@Taritsyn I've read Daniel's comment several times before I try to clone the project and based on that I have:
But I get the exception below, so I guess I didn't understand what he meant. Could you please help me with that?
|
Where you call the |
In my Application_start() in my global.asax |
Give an example of the |
|
just to add some info: |
Move the call of |
The same error happens:
and now my Application_Start looks like this:
|
|
Yes, It is also a part of the code snippet that I've added on my last comment |
Rebuild solution and clear browser cache. It should work correctly. |
@Taritsyn thanks for the help. I could run the test with JavaScriptEngineSwitcher.ChakraCore v2.4.7 and I reproduced the error. However, it still doesn't have much more information:
Also when it throws the exception, I break the code in Visual studio and this is what it has:
|
Hello, Ashkan! This problem is caused by current implementation of the /// <summary>
/// Updates the Message of a <see cref="JsRuntimeException"/> to be more useful, containing
/// the line and column numbers.
/// </summary>
/// <param name="ex">Original exception</param>
/// <returns>New exception</returns>
protected virtual JsRuntimeException WrapJavaScriptRuntimeException(JsRuntimeException ex)
{
return new JsRuntimeException(string.Format(
"{0}\r\nLine: {1}\r\nColumn:{2}",
ex.Message,
ex.LineNumber,
ex.ColumnNumber
), ex.EngineName, ex.EngineVersion)
{
ErrorCode = ex.ErrorCode,
Category = ex.Category,
LineNumber = ex.LineNumber,
ColumnNumber = ex.ColumnNumber,
SourceFragment = ex.SourceFragment,
Source = ex.Source,
};
} During wrapping loses information about the inner exception. |
Hello, Ashkan! I think that after release of the JavaScript Engine Switcher 3.0 and ReactJS.NET 4.0, you can close this issue. |
Hi Andrey,
First of, thanks for the awesome libraries. YOU ROCK!
Secondly, I have reactjs.net installed with JavaScriptEngineSwitcher.Core and JavaScriptEngineSwitcher.ChakraCore.
I've tried an stress test and IIS stopped working after 2 hours. saying:
Unfortunately because of the wrapper around the exception, I cannot say what is causing it.
To investigate more, I tried different scenarios and I've found out when I add a space into web.config which will cause the IIS to restart the application, the IIS thread will start growing little by little and after a while IIS will crash even if the stress test is stopped with error:
and
I've also made a post on stack-overflow, but I wasn't sure what is causing this and if it is the EngineSwitcher, or the JSPool that causes the error so I've just described the situation.
https://stackoverflow.com/questions/44759636/finding-memory-leak?noredirect=1#comment76500449_44759636
The text was updated successfully, but these errors were encountered: