umesh amin

umesh amin

  • NA
  • 7
  • 1.7k

How are you inspecting the heap for a .net core program on Linux?

Jul 14 2020 1:31 AM

I need to inspect the memory usage on an ETL program. The program loads about 30 GB of data into a db every 6 hours. After a day or two, the swap drive is 100% in use with a large queue. The debian 10.4 x64 system slows to a crawl. It has 20 GB of physical RAM and 8 procs @ 2.3 GHz with a SSD swap space and HDD space for the db. I'm looking to optimize the program. The idea was to look at what is taking up all the memory. Gen 2 right now has 20GB of data. Taking a dump an analyzing it would accomplish that, but the dump tool isn't working for me. I looked at lldb, but I'm unsure how to use it for this. Any ideas on how to inspect the heap/GC?

Press p to pause, r to resume, q to quit.
Status: Running [System.Runtime]
% Time in GC since last GC (%) 0
Allocation Rate / 1 sec (B) 15,087,088
CPU Usage (%) 14
Exception Count / 1 sec 0 GC
Heap Size (MB) 20,356
Gen 0 GC Count / 60 sec 180
Gen 0 Size (B) 24
Gen 1 GC Count / 60 sec 0
Gen 1 Size (B) 97,416
Gen 2 GC Count / 60 sec 0
Gen 2 Size (B) 19,650,536,328
LOH Size (B) 806,013,352
Monitor Lock Contention Count / 1 sec 0
Number of Active Timers 2
Number of Assemblies Loaded 104
ThreadPool Completed Work Item Count / 1 sec 1
ThreadPool Queue Length 0
ThreadPool Thread Count 26
Working Set (MB) 17,623
root@debian:/evd# ~/.dotnet/tools/dotnet-dump collect -p 26639 Writing full to /evd/core_20200713_092834 Writing dump failed (HRESULT: 0x80004005) root@debian:/evd#

Answers (1)