Neuron ESB User Network

The Service Bus for the Connected Business

Hello everyone,

since last week I noticed that sometimes processes failed with an OutOfMemory exception.

At first I thought there was some error in the way I am converting from XML=>JSON (using a custom c# code with JsonNet instead of the standard process step), but today apparently the same happen during an XSLT transformation.

Inner Exception Message: Insufficient memory within specified address space range to continue the execution of the program.
Inner Exception Trace: at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
at Neuron.Esb.Pipelines.EsbMessageBodyXslTransformPipelineStep.transformLocal(XslCompiledTransform compiledTransform, IXPathNavigable input, Func`2 getParameterValue)
at Neuron.Esb.Pipelines.EsbMessageBodyXslTransformPipelineStep.OnExecute(PipelineContext`1 state)
at Neuron.Pipelines.PipelineStep`1.Execute(PipelineContext`1 state)

Exception Type: Newtonsoft.Json.JsonSerializationException
Exception Message: Error getting value from 'parentItem' on '__DynamicCode.Row'.
Exception Trace: at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)

Inner Exception Type: System.OutOfMemoryException
Inner Exception Message: Insufficient memory within specified address space range to continue the execution of the program.
Inner Exception Trace: at GetparentItem(Object )
at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)

the specific Neuron instance is currently taking up 3,5GB of memory but it has 42GB of committed memory in total.

Could that be the reason why process fails? What could be the cause of such a memory use?

Thank you

Fabrizio

Views: 731

Reply to This

Replies to This Discussion

how big is the document that you are trying translate?

Hi Marty,

the document was quite small. I'm trasnalting xml => C# class => JSON so that I can have the control over the root of the resulting json as well as the property type. But still, I'm talking about small docs, it can vary from few byes (one element array, 10/15 properties) to an array of 200 elements.

The XSLT eror happened this morning but probably it was more related to the amount of memory that was allocated by the NeuronESB process, almost every service was failing.

We should probably take a look at your solution.....you may be creating and holding a lot of large things in memory.   in any case, this is a known issue with .NET 4.6.1.  You can try the work around that Microsoft posted...modifying the registry.  Here's the link:  https://support.microsoft.com/en-us/help/3152158/out-of-memory-exce...

I will send you the solution to you by email. 

I've read the MS workaround, if nothing comes up from the solution, I will consider modifying the registry.

F.

Ok...
I've actually found that was my code that was not cleaning properly the resources.

  • I had removed the root in the XmlSerializer constructor, it does seem to cause a memory leak, it is not collected as explained here XmlSerializer Memory Leak

XmlSerializer serializer = new XmlSerializer(typeof (myObj)); //, new System.Xml.Serialization.XmlRootAttribute("root"));

  • I've wrapped the StringReader in a using statement, that dispose the object...

I thought that would have been somehow cleaned automatically once the process was completed, I was wrong :-(


Just for info.. here is the full code I'm using, Hope it can help.

XmlSerializer serializer = new XmlSerializer(typeof (MyObj));
MyObj wo = null;
using(var reader = new System.IO.StringReader(context.Data.Text)){
wo = (MyObj) serializer.Deserialize(reader);
}
context.Data.Text = Newtonsoft.Json.JsonConvert.SerializeObject(wo);

RSS

Neuron ESB Product Support Forums and Communities

Latest Activity

Anupama Nair posted a discussion

Marketo Adapter Invalid Token

Hi,We are using the Marketo adapter to push account updates to Marketo. It works well for some time then starts failing with Invalid Token unless restarted. Is there a configuration that can be done so it can auto refresh the token when required?Thanks!See More
Nov 6, 2023
Sayantini Basak posted a discussion

Maximum payload size(REST API) for requests interfacing to NeuronESB

I am new to Neuron ESB and in our current scenario,We need to process batch transactions comprising of ~1000 records and send them to Neuron ESB for further processing. I would like to understand what is the maximum size of payload that can be transferred using REST interface to Neuron ESB.See More
Jul 22, 2022
Profile IconRobert E Dunie and Sayantini Basak joined Neuron ESB User Network
Apr 28, 2022
Profile IconDayanand, Frederic C, Steffen Greve-Oksfeldt and 1 more joined Neuron ESB User Network
Mar 16, 2022
Profile IconCam Vong and Mitja Luznar joined Neuron ESB User Network
Jan 27, 2022
Profile IconWill Hitzges, Chad Parsons, michael larsen and 4 more joined Neuron ESB User Network
Jun 11, 2021
Anupama Nair posted a discussion

ODBC stored proc polling with temporary tables

We have set up an ODBC adapter to poll a stored proc.We found that if the stored proc has a temporary table defined the rows returned are always 0.Any idea why this would be and what we can do to get around it?See More
Dec 14, 2020
Prasanth Kharade is now a member of Neuron ESB User Network
Dec 30, 2019

Badge

Loading…

© 2024   Created by Neuron Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service