datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

[CWS] improve memory maps file collection

Open paulcacheux opened this issue 4 months ago • 3 comments

What does this PR do?

For some time now we have hit issues with collecting the list of memory mapped files. In https://github.com/DataDog/datadog-agent/pull/17393, we introduced a max amount of collected files, but the call to gopsutil was still parsing the whole smaps file (and returning all stat entries).

This PR is the final challenger to this issue:

  • stripped down algorithm, collecting only the paths: no memory used aggregating other entries (especially the ones without path)
  • loop stops when we reach the max, actually respecting it which was not the case before
  • removes the usage of legacy gopsutil, which is always good

Motivation

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

paulcacheux avatar Mar 15 '24 14:03 paulcacheux