Strange High Memory Usage by Services

farshidhss

Dabbler
Joined
Oct 2, 2018
Messages
11
Hi everyone!

I need help to understand what is going on with my freenas memory usage. After a reboot the nas memory is normal but over time Services increases to the point that almost entire Nas is consumed (see image below)
1607537912507.png


I only have one jail with MiniDLNA and one ubuntu virtual machine with 4GB memory allocated. Can someone help me investigate why Services are consuming so much?

I'm running a system based on a Dell T1700 with 24GB memory.
 

ilmarmors

Dabbler
Joined
Dec 27, 2014
Messages
25
I have observed similar memory problem:

System Information
Platform: Generic
Version: FreeNAS-11.3-U5
Uptime: 1:45PM up 38 days, 7:14, 1 user

Screenshot 2020-12-10 at 13.43.48.png


I have only SMART, SSH, WebDav services enabled. There are 1TB a day upload via SSH. Services memory gets larger and larger over time. I have restarted SMART, WebDav services, it didn't make any changes. Sudden jump in mid November could be due to installing and running IXsystems plugin, but I stopped it after few days, but service memory didn't decrease.

Screenshot 2020-12-10 at 13.46.05.png


htop output doesn't explain where the memory shown in graph above went.
Screenshot 2020-12-10 at 13.50.49.png
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If you are going to use htop sort by Virt memory to get better results. Is anyone using auto tune? If you are disable that and all the tunable.
 

Scoot_Mulner

Dabbler
Joined
Aug 20, 2013
Messages
12
Anyone make any progress on this? I'm running into the same issue.

Screen Shot 2021-01-17 at 9.09.51 PM.png


Version: TrueNAS-12.0-RELEASE
Intel(R) Pentium(R) CPU G4620 @ 3.70GHz

I have an Ubuntu VM running with 2 GB of RAM allocated to it as well as the Syncthing plugin.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
My "collectd" process doesn't seem to be consuming nearly as much RAM as shown in your earlier screenshots.
From what you're showing, I'd agree. Not sure what's going on, then. I wonder if it's just a matter of the RAM on your system and what you're using it for.
 

Scoot_Mulner

Dabbler
Joined
Aug 20, 2013
Messages
12
For my own case, I think I have narrowed it down to the AFP service. I was watching the amount of RAM consumed by "Services" grow as my MacBook was running a TimeMachine backup. I have turned off the AFP service, rebooted and the RAM used by "Services" has stayed around 5.7 GB. I'll monitor it for a few more days and see if anything changes. If it is indeed the AFP service, is there anything I can do to fix it? I would really like to keep my backups running on my MacBook.

Screen Shot 2021-01-20 at 12.48.37 PM.png
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
For my own case, I think I have narrowed it down to the AFP service. I was watching the amount of RAM consumed by "Services" grow as my MacBook was running a TimeMachine backup. I have turned off the AFP service, rebooted and the RAM used by "Services" has stayed around 5.7 GB. I'll monitor it for a few more days and see if anything changes. If it is indeed the AFP service, is there anything I can do to fix it? I would really like to keep my backups running on my MacBook.

View attachment 44455
If you can reproduce the issue with netatalk, I'd be keen to look at it. If there's a memory leak in it, I'll try to fix it.
 

Herr_Merlin

Patron
Joined
Oct 25, 2019
Messages
200
Same here on 1 of your systems.. runs fine.
Only nfs share thats it. About 140GB used for services
 

Scoot_Mulner

Dabbler
Joined
Aug 20, 2013
Messages
12
If you can reproduce the issue with netatalk, I'd be keen to look at it. If there's a memory leak in it, I'll try to fix it.
Ok, back again after trying to nail down exactly what is happening. It is definitely the AFP service. I have two MacBook Pro's. With only one MacBook on and running Time Machine, I see higher memory usage from "Services" at about 7 - 7.5 GB. With both MacBooks on, my "Services" memory usage goes up to 13.5 GB which is almost all of my 16 GB of RAM on the machine. I set the log level to 'debug' and left TrueNAS for about 6 hrs today. That was a bit of a mistake... the afp.log file is now 2.6 GB. oops... I'll try again with a lower log level and see if there is anything obvious in it.

Not sure if it matters but one MacBook Pro is a 2018 model while the other is from 2013. Also, the drive I have shared for the Time Machine backups is full. 153.26 GiB free with 2.48 TB consumed. Time Machine says it deletes older backups to make room for the new backup. Maybe something is wrong with that?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Ok, back again after trying to nail down exactly what is happening. It is definitely the AFP service. I have two MacBook Pro's. With only one MacBook on and running Time Machine, I see higher memory usage from "Services" at about 7 - 7.5 GB. With both MacBooks on, my "Services" memory usage goes up to 13.5 GB which is almost all of my 16 GB of RAM on the machine. I set the log level to 'debug' and left TrueNAS for about 6 hrs today. That was a bit of a mistake... the afp.log file is now 2.6 GB. oops... I'll try again with a lower log level and see if there is anything obvious in it.

Not sure if it matters but one MacBook Pro is a 2018 model while the other is from 2013. Also, the drive I have shared for the Time Machine backups is full. 153.26 GiB free with 2.48 TB consumed. Time Machine says it deletes older backups to make room for the new backup. Maybe something is wrong with that?
Services usage increase in GUI isn't really what I'm concerned about (that number is relatively unhelpful). It's specifically if the the afpd process memory usage is growing without bounds. top -o res
 

Scoot_Mulner

Dabbler
Joined
Aug 20, 2013
Messages
12
Services usage increase in GUI isn't really what I'm concerned about (that number is relatively unhelpful). It's specifically if the the afpd process memory usage is growing without bounds. top -o res

Oh, top and htop don't show anything strange. For some reason the GUI seems to think all my free RAM is consumed. Even when I try to start my VM (which I have allotted 2 GB of RAM) I get an error warning me I don't have enough memory. So something is up, but I'm not sure what...
Screen Shot 2021-01-28 at 7.40.16 AM.png
Screen Shot 2021-01-28 at 7.52.58 AM.png
 

Baenwort

Explorer
Joined
Feb 19, 2015
Messages
93
So I'm seeing this also (since the U1.1 update) and I have no Apple devices that access the TrueNAS nor do I have AFP services enabled.

1612326539613.png

1612326557378.png

1612326693777.png

1612326768742.png
1612326804297.png

I do not have autotune enabled.

I am seeing performance problems on clients and a reboot of the TrueNAS server restores performance (and proper memory usage) but it seems ~.1GB is being consumed and not released per hour which results in problems after a couple days.
 

steveroch-rs

Dabbler
Joined
Feb 26, 2020
Messages
36
I'd like to add to this.
Ever since I enabled AFP to use a SMB-share to backup a MacBook Air my memory gets constantly and continuously eaten away. At least in the GUI.
I have yet to try rebooting but as you can see in the screenshots 'Laundry' is taking up bigger and bigger chunks of memory.
htop shows only 11.7G/64G used.
I am very confused. Maybe a TrueNAS dev or representative can make a statement on what's going on?



TrueNAS-MemoryUsage2.png
TrueNAS-MemoryUsage.png
TrueNAS-MemoryUsage3.png
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

Constantin

Vampire Pig
Joined
May 19, 2017
Messages
1,829
Part of jumping to TrueNAS meant for me to switch to SMB as the primary workhorse protocol - made sense since AFP is deprecated (though working well thanks to netatalk / efforts by @anodos / iXsystems / etc.) The issues of the past setting up TM backups via SMB, fruits, etc. seem resolved. The process was super solid, no special commands had to be added to share configuration setups, and so on. That said, even in Mojave, AFP works wonderfully and I find unix permissions somewhat easier to navigate than the various ACL options.
 
Last edited:
Top