Skip to content

clamd: Fix bug reporting memory stats, used by clamdtop#1465

Merged
val-ms merged 1 commit intomainfrom
CLAM-2742-memstats
Mar 13, 2025
Merged

clamd: Fix bug reporting memory stats, used by clamdtop#1465
val-ms merged 1 commit intomainfrom
CLAM-2742-memstats

Conversation

@jhumlick
Copy link
Contributor

@jhumlick jhumlick commented Mar 8, 2025

ClamD's STATS API reports process memory stats on systems that
provide the mallinfo() system call.
This feature is used by ClamDTOP to show process memory usage.
When we switched to the CMake build system, we neglected to add the
check for the mallinfo() system call and so broke ClamD memory
usage reporting.

This commit adds the CMake check for mallinfo() and sets
HAVE_MALLINFO, if found.

Fixes: #706

Jira: CLAM-2742

@jhumlick jhumlick requested a review from val-ms March 8, 2025 00:13
@jhumlick jhumlick self-assigned this Mar 8, 2025
Copy link
Contributor

@val-ms val-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual testing looks great. Fixes memstats reporting with the zSTATS command as well as in clamdtop. The commit message needs a little something. Will DM.

@jhumlick jhumlick force-pushed the CLAM-2742-memstats branch from f08e3ab to d28ec46 Compare March 13, 2025 16:35
@jhumlick
Copy link
Contributor Author

I have updated the commit message.

@val-ms val-ms changed the title Adding cmake check for HAVE_MALLINFO clamd: Fix bug reporting memory stats, used by clamdtop Mar 13, 2025
@jhumlick jhumlick force-pushed the CLAM-2742-memstats branch 3 times, most recently from 0152af3 to 1cbea3c Compare March 13, 2025 17:32
ClamD's STATS API reports process memory stats on systems that
provide the `mallinfo()` system call.
This feature is used by ClamDTOP to show process memory usage.
When we switched to the CMake build system, we neglected to add the
check for the `mallinfo()` system call and so broke ClamD memory
usage reporting.

This commit adds the CMake check for `mallinfo()` and sets
HAVE_MALLINFO, if found.

Fixes: #706

Jira: CLAM-2742
@jhumlick jhumlick force-pushed the CLAM-2742-memstats branch from 1cbea3c to 18120a0 Compare March 13, 2025 17:39
@val-ms val-ms merged commit 4dab823 into main Mar 13, 2025
23 checks passed
@jhumlick jhumlick deleted the CLAM-2742-memstats branch March 14, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken N/A MEMSTATS metrics when using STATS command

2 participants