Avatar

error when getting status data

1

moreStatusData = _api.Call<List<StatusData>>("GetStatusData", new
{
      devicesFilter = devices,
      nodesFilter = nodes,
      fromEntityIdentifier = 192359181,
      maxEntityIdentifier = 192369181

});

is resulting in....

 

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.String.CtorCharArrayStartLength(Char[] value, Int32 startIndex, Int32 length)
at FastJSON.JSONParser.ParseString()
at FastJSON.JSONParser.Parse1()
at FastJSON.JSONParser.ParseObject()
at FastJSON.JSONParser.Parse1()
at FastJSON.JSONParser.ParseArray()
at FastJSON.JSONParser.Parse1()
at FastJSON.JSONParser.ParseObject()
at FastJSON.JSONParser.Parse1()
at FastJSON.JSONParser.Parse()
at FastJSON.JSONDeserializer.JSONToTokens(String json)
at Geotab.Checkmate.Web.WebServerInvoker.<>c__DisplayClass8.<GetJsonResponse>b__7()
at Geotab.Checkmate.Web.WebServerInvoker.DummyProfiler.Record(String name, ActionDelegate action)
at Geotab.Checkmate.Web.WebServerInvoker.GetJsonResponse(Dictionary`2 jsonRequest, String requestUrl, String method)
at Geotab.Checkmate.Web.WebServerInvoker.Invoke(String method, Type returnType, Object parameters)
at Geotab.Checkmate.API.CallImpl[T](String method, Type type, Object parameters)

 

quite frequently, but not always. I have to make many calls, one after another, and eventually (around 430 calls in) I get this error. 

Any ideas? 

Thanks.

 

Mark Faucher

Please sign in to leave a comment.

1 comment

0
Avatar

Hello,

Such an exception may happen while running a x86 process (under win32 OS or an executable compiled to run as 32 bit process) occupying close to maximum allotted for 32 bit process amount of memory (more than 1.5 GB). If your call requests a significant amount of new memory to store the data received from the server, that can break the process's memory ceiling with OutOfMemoryException.

Make sure there are no memory leaks, retrieve less data simultaneously and move you application to 64 bit.

Thanks

Serge 

 

Serge Pavlov 0 votes