ParisRoubaix
ParisRoubaix

Reputation: 21

Get "Large Object Heap Size" metric using .net core running on linux

How do I get the performance counter "Large Object Heap Size" running .net core (3.1) on linux (Ubuntu 18.04)?

Upvotes: 1

Views: 3191

Answers (1)

Clint
Clint

Reputation: 6509

What is LOH:

The .NET Garbage Collector (GC) divides objects up into small and large objects. When an object is large(>=85,000 bytes), it’s considered a large object, actions like copying it in memory elsewhere on the heap -- can be expensive.Because of this, the .NET Garbage Collector places large objects on the large object heap (LOH).

Few approaches that can be explored for .NET Core Apps

  1. For Windows Specific:

    Go to Performance Monitor > AddCounter > .NET CLR Memory > Large ObjectHeap Size > Select App Name

  2. dotnet-counters:

    dotnet-counters is a performance monitoring tool for .NET Core apps

    Example Usage:

    dotnet tool install --global dotnet-counters

    dotnet-counters monitor --process-id 1902 System.Runtime

    https://github.com/dotnet/diagnostics/blob/master/documentation/dotnet-counters-instructions.md

  3. dotnet-dump:

    The dotnet-dump CLI global tool is way to collect and analyze Windows and Linux dumps all without any native debugger involved like lldb on Linux

    $ dotnet tool install -g dotnet-dump

    $ dotnet-dump collect --process-id 1902

    $ dotnet-dump analyze ./core_20190226_135850

    https://github.com/dotnet/diagnostics/blob/master/documentation/dotnet-dump-instructions.md

  4. dotnet-trace:

    The dotnet-trace tool is a cross-platform CLI global tool that enables the collection of .NET Core traces of a running process without any native profiler involved

    $ dotnet tool install --global dotnet-trace

    dotnet-trace collect --process-id <PID> --providers Microsoft-Windows-DotNETRuntime

    https://github.com/dotnet/diagnostics/blob/master/documentation/dotnet-trace-instructions.md


How do I get the performance counter "Large Object Heap Size" running .net core (3.1) on linux

enter image description here

Other Reference:

https://learn.microsoft.com/en-us/dotnet/api/system.runtime.gcsettings.largeobjectheapcompactionmode?view=netframework-4.8#System_Runtime_GCSettings_LargeObjectHeapCompactionMode

Upvotes: 3

Related Questions