Skip to content
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

OutOfMemoryException #101

Open
viveknuna opened this issue Sep 15, 2022 · 1 comment
Open

OutOfMemoryException #101

viveknuna opened this issue Sep 15, 2022 · 1 comment

Comments

@viveknuna
Copy link

viveknuna commented Sep 15, 2022

I am using this library 1.2.2 version in my windows service app, sometimes It's giving the below error and my application crashes.

Am I doing something wrong here? Can I fix this in my code? I want to keep updating the library to the latest version as the last option as it's a stable service and running for years.

this is the place where it gives the exception.

var context = new ExpressionContext();

context.Variables["Prop1"] = _rateExpression.Prop1;
context.Variables["Prop2"] = _rateExpression.Prop2;
context.Variables["Prop3"] = _rateExpression.Prop3;
context.Variables["Prop4"] = _rateExpression.Prop4;
context.Variables["Prop5"] = _rateExpression.Prop5;
context.Variables["Prop6"] = _rateExpression.Prop6;
context.Variables["Prop7"] = _rateExpression.Prop7;
context.Variables["Prop8"] = _rateExpression.Prop8;

try
{
	return (decimal)context.CompileDynamic(_rateExpression.Formula).Evaluate();
}
catch (Exception ex)
{
}

2022-09-13 15:37:31,600 [ 33] ERROR [SUSIAALGCCWSXT1] - System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.LookAheadSet.Sequence..ctor(Boolean repeat, Int32 token)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, Int32 dummy, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternAlternative alt, Int32 length, Int32 pos, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPattern pattern, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, Int32 dummy, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternAlternative alt, Int32 length, Int32 pos, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPattern pattern, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, Int32 dummy, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternAlternative alt, Int32 length, Int32 pos, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPattern pattern, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, Int32 dummy, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternAlternative alt, Int32 length, Int32 pos, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPattern pattern, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, Int32 dummy, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternElement elem, Int32 length, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.FindLookAhead(ProductionPatternAlternative alt, Int32 length, Int32 pos, CallStack stack, LookAheadSet filter)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.CalculateLookAhead(ProductionPatternAlternative alt, Int32 pos)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.CalculateLookAhead(ProductionPattern pattern)
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.RecursiveDescentParser.Prepare()
at Flee.Parsing.grammatica_1._5.alpha2.PerCederberg.Grammatica.Runtime.Parser.Parse()
at Flee.PublicTypes.ExpressionContext.DoParse()
at Flee.PublicTypes.ExpressionContext.Parse(String expression, IServiceProvider services)
at Flee.InternalTypes.Expression1.Compile(String expression, ExpressionOptions options) at Flee.InternalTypes.Expression1..ctor(String expression, ExpressionContext context, Boolean isGeneric)
at FxRateCalculationLib.Common.RateExpressionEvaluator.Evaluate()

@viveknuna
Copy link
Author

@hunkydoryrepair @eskaufel @clarencegarcia @bondjames12 @bcgrillo @JnsV @PekkaVe @mparlak is there anyone who could help on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant