Memory usage by Freenas

Status
Not open for further replies.

flyinfitz1

Explorer
Joined
Mar 29, 2013
Messages
91
Ive noticed that memory doesnt ever return to "free" unless I reboot the system. See attached image. Is this normal? It seems all the memory is being used within a matter of hours after reboot as well. Faster if Im using the services like plex or SMB frequently.

SPECS:
Lenovo TS140
FreeNAS-9.3-STABLE-201509160044
PlatformIntel(R) Core(TM) i3-4130 CPU @ 3.40GHz
Memory 12 GB ECC
HDD: 4x3TB RAID-Z2 Western Digital Red
 

Attachments

  • Memory.png
    Memory.png
    38.8 KB · Views: 860

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Perfectly normal. FreeNAS, like most modern and intelligent operating systems, will consume all (or almost all) the RAM you give it, for caching if nothing else. Since FreeNAS uses ZFS, there's a lot of caching going on.
 

flyinfitz1

Explorer
Joined
Mar 29, 2013
Messages
91
Thanks everyone, I guess Im stuck in the Windows world where completely used RAM can cause adverse performance of the system.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Thanks everyone, I guess Im stuck in the Windows world where completely used RAM can cause adverse performance of the system.
Same as any OS...

And like any modern OS, Windows will cache frequently-used files in unused RAM and FreeNAS will hand over unused RAM to ZFS, which will cache stuff in ARC.
Do not mistake "unused" with "unavailable". If it comes to that, ARC can be reclaimed for other processes.
 

NAStard

Dabbler
Joined
Aug 30, 2015
Messages
25
Hello,

Are the RAM requirements for FreeNAS dropping?
Perhaps on the latest release?
FreeBSD freenas.local 9.3-RELEASE-p28

On my system, I recall that the memory graphs
in the Reports section of the GUI indicated that
memory was always nearly maxed out or perhaps
memory was never returned after being allocated.
But now it appears I have plenty of free memory,
like 6GB. And that's awesome! :)

I wonder what changed? The FreeBSD platform
or the reporting tools?

:D
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Hello,

Are the RAM requirements for FreeNAS dropping?
Perhaps on the latest release?
FreeBSD freenas.local 9.3-RELEASE-p28

On my system, I recall that the memory graphs
in the Reports section of the GUI indicated that
memory was always nearly maxed out or perhaps
memory was never returned after being allocated.
But now it appears I have plenty of free memory,
like 6GB. And that's awesome! :)

I wonder what changed? The FreeBSD platform
or the reporting tools?

:D
Or the amount you're using the NAS after the last reboot / time since last reboot. If you want lots of free ram, reboot all the things. Often. :D
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Hello,

Are the RAM requirements for FreeNAS dropping?
Perhaps on the latest release?
FreeBSD freenas.local 9.3-RELEASE-p28

On my system, I recall that the memory graphs
in the Reports section of the GUI indicated that
memory was always nearly maxed out or perhaps
memory was never returned after being allocated.
But now it appears I have plenty of free memory,
like 6GB. And that's awesome! :)

I wonder what changed? The FreeBSD platform
or the reporting tools?

:D
In a word? No.
 

devnullius

Patron
Joined
Dec 9, 2015
Messages
289
I understand: "use all RAM available"...

But when there's nothing to do, no IO, no nothing I can think off... I feel it is strange to keep that 'old' data persistently in RAM. Nothing wrong with releasing RAM even if you have plenty to spare, no? :)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I understand: "use all RAM available"...

But when there's nothing to do, no IO, no nothing I can think off... I feel it is strange to keep that 'old' data persistently in RAM. Nothing wrong with releasing RAM even if you have plenty to spare, no? :)
It's released as soon as ZFS thinks something would benefit more from being in RAM.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
It's released as soon as ZFS thinks something would benefit more from being in RAM.
Indeed.

As you read from your pool, the blocks you are reading become part of your ARC, which has a number of subparts, include a "most recently used" MRU, and a "most frequently used" MFU cache. It will consume as much RAM as appears to be freely available for those tasks, minus about 1GB typically. The nice thing is that the ARC cache is wholly dispensible; when a process requests a large amount of RAM that isn't available, FreeNAS (rather, ZFS) will, as needed, relinquish the least useful parts of whatever it has in the ARC, so that no one is starved for required RAM.

It's perfectly normal, cuspy, behavior, sir.
 

devnullius

Patron
Joined
Dec 9, 2015
Messages
289
M'am :) Ok, thanks for the feedback. On the end of the day, it feels 'bad' to me, not releasing RAM. But I understand what they are doing :)
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
It's released as soon as ZFS thinks something would benefit more from being in RAM.

Or as soon as ZFS is *sure* that the data has no further value, such as when you free a block on the pool (think: file deletion, etc).

The classical example is to read a file that is a substantial portion of your ARC repeatedly, until it is clearly cached in ARC, and then delete the file. Suddenly your ARC size will plummet.

There is absolutely no value to freeing RAM just to have "more" "free" RAM. That's just kinda a geek-handwringing thing and ZFS will actually use as much ARC as you give it (up to the size of the stored/accessed data on the pool).
 

devnullius

Patron
Joined
Dec 9, 2015
Messages
289
"Or as soon as ZFS is *sure* that the data has no further value, such as when you free a block on the pool (think: file deletion, etc)." - that makes me breath normally again :)

"You paid for the RAM. Shouldn't the system use it for something?" - so you keep your brand new Mercedes running 24/7? ;-)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
"You paid for the RAM. Shouldn't the system use it for something?" - so you keep your brand new Mercedes running 24/7? ;-)
Does having data in your RAM cause any more wear than not having data in the RAM? If so, your question is relevant. If not, however, this is a red herring.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
"Or as soon as ZFS is *sure* that the data has no further value, such as when you free a block on the pool (think: file deletion, etc)." - that makes me breath normally again :)

"You paid for the RAM. Shouldn't the system use it for something?" - so you keep your brand new Mercedes running 24/7? ;-)
You do, if you're a taxi company.
 

devnullius

Patron
Joined
Dec 9, 2015
Messages
289

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Status
Not open for further replies.
Top