# High Wired memory usage !!



## shahzaib (Nov 3, 2016)

Hi,

We've 96 GB memory and I can see that 76 GB is wired and there's also total ARC 69 GB already occupied. My question is, if FreeBSD requires additional memory for processes will wired/ARC release the memory for FreeBSD usage to prevent swap usage? Since 12 GB is only free. Will OS start going into swap if 12 GB free gets utilized instead of using memory from wired or ARC?

http://prntscr.com/d2jwad


----------



## Remington (Nov 3, 2016)

Try adding this to /boot/loader.conf and see if it helps.  My server got 96GB memory and set the arc to 4G with no issues.


```
vfs.zfs.arc_max="4G"
```


----------



## shahzaib (Nov 3, 2016)

But it'll minimize ARC caching which we need to serve content from caching. Current default is :

```
vfs.zfs.arc_max: 99317161984
vfs.zfs.arc_min: 12414645248
```
Regarding vfs.zfs.arc_min, does that mean if OS requires memory ARC will release it up to the point on its vfs.zfs.arc_min commitment? Which is by default 12 GB on this system.

My main concern is, will OS release ARC memory if requires to?


----------



## SirDice (Nov 3, 2016)

Handbook: 19.6. Advanced Topics


----------



## Remington (Nov 3, 2016)

It'll change depending on how much buffer it needs to write to zfs pools so you may want to limit the buffer to 4 or 8G.  If you are using deduplication or compression with heavy writes then arc_max needs to be raised to improve the write time.


----------



## kpa (Nov 3, 2016)

Remington, the ARC cache is purely a read cache.

Depending on how this server is used the 4GBs of ARC cache just may not cut it. If this is a heavy duty file server that is mostly read-heavy and less writes to the ZFS pool you definitely want to give it as much ARC cache as you can without compromising the other functionality of the operating system. From the looks of it you could limit the maximum size of the ARC cache to 64GBs if my assumption about the use of this server is correct?

The size of the cache will autoscale if free memory becomes scarce but it may be a better idea to use manually set maximum limit to be on the safe side.


----------



## Remington (Nov 3, 2016)

kpa said:


> Remington, the ARC cache is purely a *read cache*.
> 
> Depending on how this server is used the 4GBs of ARC cache just may not cut it. If this is a heavy duty file server that is mostly read-heavy and less writes to the ZFS pool you definitely want to give it as much ARC cache as you can without compromising the other functionality of the operating system. From the looks of it you could limit the maximum size of the ARC cache to 64GBs if my assumption about the use of this server is correct?



Thanks for clarifying that.  My server have SSD so arc with 4GB is not an issue.  I would say 4GB is bare minimum for a web server as I haven't run into any issues for 2 years.


----------

