-
-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic memory diagnostics #1883
Comments
Instead of individual static properties for "memory info" there should be only static method, that in turn return a type which represents the memory info. namespace SixLabors.ImageSharp.Diagnostics
{
public static class MemoryTracker
{
public static MemoryInfo GetMemoryInfo();
// Make the library throw in finalizers if stuff was left undisposed
public static bool EnableStrictDisposeWatcher { get; set; }
}
// or a normal struct, here just for simplicity
public readonly record struct MemoryInfo(long TotalUndisposedLogicalAllocationCount);
} That way it's easier extend the memory info and/or get the "info at once" without the need to query several properties (in the assumption that there will be more properties for memory info in the future). This should be the first point to start with. Personally I'm quite busy now, so I don't feel able to do the first step. But (later) for the event counters I'm sure to help out (use these in my work project quite extensively, so some good patterns evolved for implementing). |
@gfoidl great idea thanks!
We would definitely appreciate help! |
In general, telemetry is something that would be great to see being introduced in the library, but we are struggling to find time for it. |
While documenting the implementation I realized I'm not sure about the A single static property is much easier to discover. I prefer whatever helps the user more at this point. |
Spinning off #1739 (comment) to an issue.
We need expose some basic memory diagnostic utilities from library code:
We should also introduce standard event counters, but that's a different story for a separate issue later.
The text was updated successfully, but these errors were encountered: