Inactive memory rising rapidly every morning around 3:30am

Started by goobs, February 24, 2025, 10:13:37 AM

Previous topic - Next topic
I have now added periodic.conf overrides so logs are saved to /var/log/daily.log etc instead of "root" as there is no mail installed.
That got rid of the mail error and on inspection of the daily.log I can see no issues.

I do not use ZFS and these tasks are not part enabled in the daily other than the default list zfs pools.

Again from a fresh boot I run periodic daily and Inactive memory rises from 100M to 1280M.
From another ssh shell I can see pkg appear in top processes during the time the inactive memory rises. Then pkg goes and I briefly see 'xz' then it is over.

I am thinking to turn off all parts of the periodic daily then enable one at a time to see which element is causing the issue.

Update:

After changing anything set to "YES" to "NO" in periodic.conf and running #periodic daily then one by one setting No to YES repeating the test I was able to track the memory rise down to the security section.

I don't know why the daily security check causes Inactive Mem to go from 100M to 1250M but it does.

There were some issues reported in the security log as attached but searching forums.freebsd.org suggested this compat_var was deprecated so I don't know it is still present in the system.
https://github.com/freebsd/pkg/commit/6a077c32f445bfb10bab5536910b6b7329ce43d3

Something is messed up with my system that security check has issue with and for some reason keeps raising Inactive Mem.

Am I at the stage where I wipe and start again or can any guru shed light on the issue please ?

Update 2:

I have built a test instance of OPNsense 25.1 in Hyper-V and repeated the above periodic.conf and tests.

The output of dailysecurity.log is the same mentioning security_daily_compat_var : not found , so I know my system is not missing something that a rebuild will put back.

Also the inactive mem rises by 1000M after running periodic daily so that behaviour is the same. Again, no zfs and this is a vanilla install so no plug-ins etc.

Subsequent runs of periodic daily, periodic weekly and period monthly do not add that much to inactive mem so perhaps this is just how it is and I need to allow for the expansion when choosing plug-ins to avoid OOM reaper killing of Unbound, Caddy etc. ?

<3>pid 52659 (caddy), jid 0, uid 0, was killed: failed to reclaim memory

That didn't last long. Still had 4GB unused memory too.

Time for a beer or ten.