# ZFS Memory leak



## BlueCoder (Apr 9, 2013)

I thought I had this solved a while back but evidently not. I recently started a local SVN FreeBSD mirror jail and running a SVN checkout on the ports tree trashes my system. All the memory slowly evaporates away within an hour or two. I experienced this before and apparently the problem didn't go away but only slowed down the decay.

The box is an old Pentium 4 that I use mostly as a fileserver. It has 3GB of memory. I experience the problem with the GENERIC kernel and as of now I have GENERIC with Dtrace compiled in for debugging. I use the following setting to try to limit ZFS memory usage:

```
vfs.zfs.arc_max="200M" 
vfs.zfs.vdev.cache.size="5M"
```
I using RELENG 9.1 so it's not the old memory leak issue.

Any suggestions for tracking the issue down would be appreciated.


----------



## kpa (Apr 9, 2013)

Is it an i386 system? There are some known problems related to kernel memory fragmentation when using ZFS on i386. The only solution afaik is to use hardware that supports amd64 and amd64 version of FreeBSD.


----------



## BlueCoder (Apr 9, 2013)

Yes it is an i386. It's a Pentium 4. What problems exist and are they documented somewhere?


----------



## kpa (Apr 9, 2013)

I can't give you any references right now but the biggest problem is the limited kernel memory address space that does not allow much "shuffling around" of deallocated memory pages to merge the pages into bigger units for re-use. This results in memory fragmentation when the system is on for longer periods of time. Eventually the kernel memory address space gets so fragmented that no more memory can be allocated resulting in a kernel panic.

AMD64 does not suffer from this problem because the virtual address space (address space, not the total amount of kernel memory mind you) for the kernel can be hundreds of gigabytes or even more since the addressing is not limited to 32 bits.


----------



## AndyUKG (Apr 9, 2013)

Can you post the output of [cmd=]top[/cmd] ordered for memory use and also the ARC section from [cmd=]zfs-stats[/cmd]?


----------

