Recommended Actions for mitigation:
Review the Diff Check Settings
The <diff> option can consume a large amount of memory when enabled on large files.
Consider disabling it or setting a lower <limit> to control resource usage.
Refer to the Wazuh diff check documentation: https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/syscheck.html#diff
Exclude Unnecessary Directories
Avoid scanning entire drives or large system paths.
Use the <ignore> tag to exclude non-critical directories and reduce scanning load.
See the documentation on ignored files: https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/syscheck.html#ignore.
Check the size and count of monitored files
If the total size or number of files is large, the scan will take significant time and memory, especially if diff checks are enabled.
Analyze System Resources
Use tools like Process Explorer (on Windows) or top / htop (on Linux) to monitor:
Total system memory usage
Memory consumption by wazuh-agent.exe
Number of open handles for the agent process
Review Agent Configuration
Certain configurations can cause long-term memory issues, such as specifying files instead of directories in <directories> blocks, if realtime or whodata options are enabled for them.