LAN causing Memory hogging

Status
Not open for further replies.

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
Hi

I have noticed since setting up my media server that if I start playing streams the memory allocated to the Lan increases, however once I stop streaming and have no other connection i.e. I unplug the Lan cable. I still find the memory is all used up and if not after a short period the Lan will take it all and not release it.
could anyone provide some advice to resolve this issue?

Screenshot 2013-11-02 22.11.25.png
Screenshot 2013-11-02 22.12.00.png
Screenshot 2013-11-02 22.25.12.png
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Um. What is the problem? This looks OK to me.

As the system runs, and files are served, most of the memory will ultimately become "wired". Should take up about 75-85% of the memory, then level off. Which is exactly what your thing appears to be doing? Then, as you continue to serve files, some RAM will be reclaimed, etc., and it should all stay level more or less. And again, that's exactly what your thing appears to be doing.

So maybe I don't understand you, but everything looks normal to me. This is normal ZFS RAM utilization, I believe.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
I assume you refer to the wired memory. Wired memory is actually the memory used by the FreeBSD kernel, it has nothing to do with LAN. As you start streaming, ZFS will request memory for its cache (ARC). Unless the kernel needs the memory for something else the data will stay there (the memory will not be released) so that the cache can do its magic when you decide to access the same data again. This is a correct behavior and there's nothing to worry about.
 

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
I assume you refer to the wired memory. Wired memory is actually the memory used by the FreeBSD kernel, it has nothing to do with LAN. As you start streaming, ZFS will request memory for its cache (ARC). Unless the kernel needs the memory for something else the data will stay there (the memory will not be released) so that the cache can do its magic when you decide to access the same data again. This is a correct behavior and there's nothing to worry about.

Hi Dusan, I was guessing that the graph was a representation of the 6gig of actual hard memory (DIMM) that I have installed and not any virtual memory.

I was concerned whether 6gig was enough for streaming to multiple devices and having to do transcoding possibly, and using all of it up left nothing spare for other operations?

Also if this is the case and I had say 16gig installed, would it try and take it all?

many thanks for your advice
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Hi Dusan, I was guessing that the graph was a representation of the 6gig of actual hard memory (DIMM) that I have installed and not any virtual memory.

I was concerned whether 6gig was enough for streaming to multiple devices and having to do transcoding possibly, and using all of it up left nothing spare for other operations?

Also if this is the case and I had say 16gig installed, would it try and take it all?

many thanks for your advice

I think basically the whole point is it will cache as much as it can, so yes, it will take up what you give it. You're not "running out of memory" here, you're fine. This is totally normal behavior; the philosophy is: "If there's memory there, and I can cache things, then why wouldn't I?" You've almost certainly got more than enough for any home server use; don't be concerned that it's "used". Any/all of this "used" memory will become available if the system need it, automatically. Everything's fine.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Hi Dusan, I was guessing that the graph was a representation of the 6gig of actual hard memory (DIMM) that I have installed and not any virtual memory.
Correct, what you see is the physical memory.
I was concerned whether 6gig was enough for streaming to multiple devices and having to do transcoding possibly, and using all of it up left nothing spare for other operations?
I don't use plugins, so I have no idea how much memory you need for transcoding. However, the kernel will release/free the ARC cache memory when there is memory pressure. On the other hand, it will not release it if there is currently no other use for it. You need to understand that having "free" memory is a waste. Any free memory can be utilized as a cache to potentially speed up disk operations and the kernel will aggressively do so.
You can also limit the kernel memory usage by setting various tunables (vm.kmem_size_max, vm.kmem_size, vfs.zfs.arc_max, ...), see System->Tunables. If you enable autotune (System->Settings->Advanced) it will set the tunables for you. The autotune logic reserves at least 2,25GB for userland processes. With 6GB of physical RAM it would limit vm.kmem_size (kernel) to 3GB and vfs.zfs.arc_max (cache) to 2,7GB. With 16GB of physical RAM it limits kmem to 11GB and arc to 9,9GB.
 

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
Thanks guys for clearing that up for me..I understand and am better educated for it :)
 

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
Will mark this as Answered.
 
Status
Not open for further replies.
Top