Comments (5)
@jamescrosswell any chance you could verify the fix in #3382 ?
It works - thanks @vaind!πΊπ»
![image](https://private-user-images.githubusercontent.com/728212/333168850-2b493c94-f377-4277-8697-8988e05c20f3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY4NDYyNjEsIm5iZiI6MTcxNjg0NTk2MSwicGF0aCI6Ii83MjgyMTIvMzMzMTY4ODUwLTJiNDkzYzk0LWYzNzctNDI3Ny04Njk3LTg5ODhlMDVjMjBmMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNTI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDUyN1QyMTM5MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yNzY3Y2RlNGUxZmRlNTg2ZWMwODE1Y2ZkYWNmNGFjYWI4NTc2NjA2NDg3NmFmOGJhNGVlMzQ5Mjc1Mzg2ODcyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.1Aafa-RostdFWelNEhPwkrxSpwAOyBGDlwLMb1nTcKY)
from sentry-dotnet.
thank you!
for reference: this was the actual fix: microsoft/perfview@36d2e2c#diff-31ffbfdad96fc84f3aa7d25e1980cdca5a4d7870529c669ac9cc975cf24969c8R342
from sentry-dotnet.
So there does appear to be an issue here. This is what I'm seeing when I run the service in a memory profiler:
Although the LOH and POH do get cleaned up occassionally (somewhat), over time these just keep growing and growing. Heap Gen 0, 1 and 2 all appears stable.
The only thing that I can think might be using the LOH or POH is profiling, which might need to pin objects when passing pointers to unsafe code. I see a number of instances where the PerView module pins objects (e.g. here).
That's consistent with the call tree, which indicates 99% of the memory is being used by instances of EventMarker
, which is an internal class used by modules/perfview/src/TraceEvent/EventPipe/EventCache.cs
:
The EventMarker
constructor takes a PinnedBuffer
as an argument.
It looks like the ProcessEventBlock method creates multiple EventMarker
instances and never explicitly cleans any of these up.
I'll play around to see if I can explicitly free these up.
from sentry-dotnet.
When I look at the generations I can see:
Pretty much all of that is accounted for by Microsoft.Diagnostics.Tracing.Etlx.TraceLog+EventsToStackIndex[]
![image](https://private-user-images.githubusercontent.com/728212/332263793-6b653bfa-ff4b-43f3-a149-896d181bac5d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY4NDYyNjEsIm5iZiI6MTcxNjg0NTk2MSwicGF0aCI6Ii83MjgyMTIvMzMyMjYzNzkzLTZiNjUzYmZhLWZmNGItNDNmMy1hMTQ5LTg5NmQxODFiYWM1ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNTI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDUyN1QyMTM5MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02NzNhZWI2YzdkZGE1NzNjNDgzYjA5ZGZmNTg5ZTdlNzFmMWU3MTBmNGI3NTAyYTM3NTlmMjdjNjc0Mjk5ZGZlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.vGSn7qR8frTnTlMwKJVDe3-5CHlFLrWDxnLeEpzRngU)
I see events get added to that stack here but the only place I see them being removed is in the internal FlushRealtimeEvents method, which in turn gets called by TraceLogProcess, which we call here when starting the profiling:
As far as I can tell then, that GrowableArray just gets bigger and bigger, and there are no public APIs that we can use to flush out old item.
@vaind any ideas?
from sentry-dotnet.
@jamescrosswell any chance you could verify the fix in #3382 ?
from sentry-dotnet.
Related Issues (20)
- Support `UWP` via package
- Missing AddAttachment from memory in SentryHint HOT 1
- De-obfuscate stack traces with Babel Obfuscator HOT 1
- [MAUI] Make it possible to programmatically decide whether to attach a screenshot or not HOT 2
- Profiling: Error out in the editor if added to unsuported platform HOT 3
- Add SentrySdk.RunAsyncVoid helper method to Sentry SDK
- Memory Profiling HOT 1
- Unable to cast object of type 'Sentry.Log4Net.SentryAppender' to type 'log4net.Appender.IAppender' HOT 4
- OOTB metrics HOT 1
- Could not get pinvoke, or callbacks for method 'Sentry.Native.C::sentry_options_set_logger' HOT 2
- Document requirement for active scope transaction
- Url parameter secrets are not sanitized by default in ASP.NET HOT 6
- Improve Sentry CLI utilization HOT 1
- Deprecate `EnableTracing`
- Consider `Mechanism.Handled` for non-thrown captured exceptions HOT 1
- Envelopes stuck in `__processing` until restart HOT 2
- Instrumenting failed AWS SDK requests throws due to AWS's use of UriCreationOptions.DangerousDisablePathAndQueryCanonicalization HOT 3
- UWP events missing debug_meta.images information HOT 1
- Exceptions captured through `Extensions.Logging` marked as `handled = true` HOT 9
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.