OutOfMemoryException
See original GitHub issueDescribe the bug We are using this sink to push data into Logstash, however we get out of memory exception. I want to understand if this exception can be raised when logstash is slow in processing data, we do push data from many PCs. Also, this exception ends up crashing the application.
Is there anything in 8.0 version that could help?
2021-05-18T11:01:25.5710337Z Exception while emitting periodic batch from Serilog.Sinks.Http.Private.Sinks.HttpSink: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Text.StringBuilder.ToString()
at System.IO.StringWriter.ToString()
at Serilog.Sinks.Http.Private.Sinks.HttpSink.FormatPayload(IEnumerable`1 logEvents)
at Serilog.Sinks.Http.Private.Sinks.HttpSink.<EmitBatchAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.<OnTick>d__21.MoveNext()
2021-05-18T11:01:28.2768308Z Exception while emitting periodic batch from Serilog.Sinks.Http.Private.Sinks.HttpSink: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Text.StringBuilder.ToString()
at System.IO.StringWriter.ToString()
at Serilog.Sinks.Http.Private.Sinks.HttpSink.FormatPayload(IEnumerable`1 logEvents)
at Serilog.Sinks.Http.Private.Sinks.HttpSink.<EmitBatchAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.<OnTick>d__21.MoveNext()
2021-05-18T11:01:38.9878217Z Exception while emitting periodic batch from Serilog.Sinks.Http.Private.Sinks.HttpSink: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Text.StringBuilder.ToString()
at System.IO.StringWriter.ToString()
at Serilog.Sinks.Http.Private.Sinks.HttpSink.FormatPayload(IEnumerable`1 logEvents)
at Serilog.Sinks.Http.Private.Sinks.HttpSink.<EmitBatchAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.<OnTick>d__21.MoveNext()
Desktop (please complete the following information):
- OS: Windows 10 1909
- Version: 7.2.0
Expected behaviour
It should not crash, rather error should be logged in SelfLog
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
OutOfMemoryException Class (System)
When data structures or data sets that reside in memory become so large that the common language runtime is unable to allocate enough...
Read more >C# : Out of Memory exception
Today my application threw an OutOfMemoryException . To me this was always almost impossible since I have 4GB RAM and a lot of...
Read more >C# OutOfMemoryException
The OutOfMemoryException is a runtime exception that tells the programmer that there is no enough memory or there is a lack of contiguous...
Read more >3.2 Understand the OutOfMemoryError Exception
Usually, this error is thrown when there is insufficient space to allocate an object in the Java heap. In this case, The garbage...
Read more >Debugging System.OutOfMemoryException using .NET tools
To start debugging the OutOfMemoryException , I recommend you to look at your application either through the Task Manager or using perfmon.msc ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The unit of
queueLimit
is currently number of events and not total size in bytes, which would be a lot better, and easier to reason about.I’ll add a task that we should change the non durable sink to respect a total memory size, instead of respecting the number of events. That would make great sense. As v8 isn’t currently official yet, we should aim to include this breaking change in the release.
Thanks for the feedback!
Closed in favour of #203