Comments (11)
We are still experiencing high memory usage related to this
@jamescrosswell is there anything we can do in the short term?
from sentry-dotnet.
Yes happy to do so.
from sentry-dotnet.
We should start looking into something similar to #829
If the SDK knows a transaction is going to get sampled then all the potential childspans can do a noop. That way users regain some control over the memory consumption via the sample rate.
from sentry-dotnet.
@jamescrosswell is there anything we can do in the short term?
@cliedeman as far as I know, the original memory leak this ticket relates to was fixed in:
The purpose of this ticket was to explore a more elegant solution.
We know of a memory leak in Sentry.Profiling (which is still not GA) but otherwise it should all be airtight.
If you're seeing memory growing monotonically and you're not using Sentry.Profiling
then we'd definitely like to dig deeper. The first step for us is always reproducing the problem so if you can share a small sample project that recreates the issue then we can look into it.
from sentry-dotnet.
Profiling is not enabled.
I dont believe its growling monotonically. We haven't found a pattern - I think this could be possibly be because of an increase in exceptions but these exceptions are filtered sdk side. We had one isue where 3 OOM errors follow about an hour in between.
Thanks
Ciaran
from sentry-dotnet.
I dont believe its growling monotonically. We haven't found a pattern - I think this could be possibly be because of an increase in exceptions but these exceptions are filtered sdk side. We had one isue where 3 OOM errors follow about an hour in between.
Ah, in that case maybe related to @bitsandfoxes 's comment. In the dump you've shown above, the largest consumer of memory appears to be a concurrent bag that is storing trace information... so TransactionTracer and SpanTracer instances. You'd have to be creating an absolute tonne of these to get an OOM exception though.
The other possibility is the MemoryCache shown in your dump.
You'd really need to capture a dump just before an OOM exception was thrown to be sure which was the culprit though. It may be that in normal circumstances, Sentry's concurrentbag is allocating relatively more memory than other stuff in the process but in the circumstances leading up to your OOM exception it's something else entirely.
I put together an experiment a while back with some code that you could potentially include in your application to capture the dump at the right time (just before the OOM).
from sentry-dotnet.
These are the azure crash monitor dumps taken at crash time
from sentry-dotnet.
These are the azure crash monitor dumps taken at crash time
And was that an OOM crash? So you've got less than 400MB of memory available to the process?
from sentry-dotnet.
Unsure. The server definitely has more memory. There is no increase in server error rates or increase in request rates. I'll scrutinize the dumps later to try and see why there are so many spans because that doesn't make sense to me. I am also willing to share the dumps.
Also the server is 32bit and the OOM could be caused by a collection hitting the max size not just heap size
from sentry-dotnet.
Let me rephrase my thinking.
Our application is crashing with OOM. There are no obvious suspects. Sentry is the highest memory user according the dumps.
There are several issues related to memory on this repo. I would like to atleast eliminate sentry from the causes.
I could turn off sentry and observe that the issues stop but Sentry is really useful.
from sentry-dotnet.
We will prioritize getting on top of the SDK's memory consumption.
@jamescrosswell has a PR for some optimization experiment #3434
@cliedeman would you be able/willing to run an alpha build and see if that does anything to reduce this issue?
from sentry-dotnet.
Related Issues (20)
- Crons: Sentry.Hangfire not reporting finished jobs and reporting jobs that were not started HOT 1
- Stack Trace missing for NativeAOT App HOT 9
- Missing Trace Root HOT 7
- Allow SDK/CLI/MSBuild integration to create a Release HOT 2
- Allow setting Release via an MSBuild property HOT 7
- SentrySdk.CaptureException should add a breadcrumb for future exceptions HOT 2
- Serilog integration makes app hang on MAUI HOT 6
- Starting Maui app only once - gives 2 users and 2 sessions in Sentry 'Releases' section. HOT 3
- [Bug/question] ISentryEventProcessor not being invoked w/ Sentry.Extensions.Logging HOT 1
- Report dropped spans in client reports
- logcat.log is not attached to unhandled event (SIGSEGV Segfault) HOT 5
- [Android] Crash with `EnableBeforeSend` enabled HOT 5
- Verify tests failing intermittently due to changing CodeId length HOT 2
- Fix class names in ApiDefinitions.cs
- MAUI: Don't rely on DeviceDisplay/DeviceInformation HOT 1
- Race Condition in SentryMessageHandler - System.InvalidOperationException: This instance has already started one or more requests. Properties can only be modified before sending the first request. HOT 1
- Gauges not reporting custom metrics HOT 7
- Support Spotlight without sending to Sentry HOT 4
- Unable to load DLL 'sentry-native' or one of its dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-dotnet.