ARC memory keeps increasing

root@sapnfssrv[~]# top -b
last pid: 42505;  load averages:  0.31,  0.28,  0.24  up 10+22:29:00    09:44:35
57 processes:  1 running, 56 sleeping

Mem: 153M Active, 1233M Inact, 11G Wired, 2806M Free
ARC: 8028M Total, 4371M MFU, 3019M MRU, 854K Anon, 161M Header, 477M Other
     6393M Compressed, 26G Uncompressed, 4.19:1 Ratio
Swap: 2048M Total, 2048M Free

I keep an eye on ARC, it increased from 4000M to 8022M within two weeks. And I have to set the max value to 8192M. Is it normal ?

The version of freeNAS we’re using is FreeNAS-11.3-U4.1.

It’ll generally try to fill as much memory as the max is set to. Unused memory is wasted memory after all.

Perfectly normal.

1 Like

To add to that, I wouldn’t arbitrarily limit the ARC on a FreeBSD system.

1 Like

Thanks for your prompt reply.

Will it swap out when memory is running out for not OOM an application or OS ?

Yes - never experienced issues with that on FreeBSD.

1 Like

okay, thanks.
if I set the maximum ARC to 8192M, it won’t exceed this number, right ?

Not unless something is very wrong. To add I’m not sure if you got it as a startup script to manually set that on boot - if not rebooting would likely reset to default.

On FreeBSD I wouldn’t even bother manually setting anything; as winnie previously mentioned. On FreeBSD, ARC will eat up to like 80% of total ram (if I remember correctly), if available, & does an excellent job reducing in size on the fly as needed & then building back up when available again. I don’t remember ever having any issues due to ARC on TruenasCore.

1 Like

Thanks.
I’m using FreeNAS-11.3-U4.1, is it applicable as well ?

Yes - that version is based on FreeBSD; what I said is 100% applicable.

Additional information that is not relevant to your question, but fun anyway:

The newer Scale versions instead run on linux instead of freebsd. If instead you were running one of a specific few older versions of Truenas Scale, then it might make some sense to limit ARC size. On latest Scale version it should also be fine to leave at default.

Okay, thanks for your kind help. :slight_smile:

I still have a concern that wired memory keeps increasing. Can it be swapped out when necessary ?
Current status is 12G, comparing to that of this morning. 1G memory is taken out.

Mem: 152M Active, 1247M Inact, 12G Wired, 2632M Free

Have you actually had an OOM moment happen?
If not, this is not worth worrying about.

2 Likes

Thanks.
But the free memory is decreasing gradually. I’m concerned it’ll eat up all memory and cause OOM.
Would it swap out and release memory accordingly when running out memory? Generally, all OS would do this task.

Mem: 149M Active, 1261M Inact, 12G Wired, 1856M Free
ARC: 7975M Total, 3662M MFU, 3621M MRU, 632K Anon, 165M Header, 526M Other
     6133M Compressed, 20G Uncompressed, 3.33:1 Ratio
Swap: 2048M Total, 2048M Free

Been using truenas for over 3 years now and never had problems with the sytem going OOM, even when i was only using 16GB of ram. As already mentioned zfs will use all available memory it can get, and will increase until only 1% (i believe) Memory is left free. If the the system needs memory, for a system process or to start a vm, arc will shrink itself down.

4 Likes

okay, thanks.

hello, guys.
Thanks for your replies and patience.
I have kept an eye on the memory usage in recent days.
Now the stats is

Mem: 150M Active, 1277M Inact, 13G Wired, 1474M Free
ARC: 8191M Total, 3574M MFU, 3888M MRU, 532K Anon, 169M Header, 560M Other
     6423M Compressed, 21G Uncompressed, 3.38:1 Ratio
Swap: 2048M Total, 2048M Free

The wired memory grows day by day. would it be reclaimed once FreeNAS is running out of memory and not cause other applications and OS OOM?

Thanks for your kind help.

yes.

Appreciated.