System restarting when the free memory is low

Kannderni

Dabbler
Joined
Oct 26, 2021
Messages
25
I have a bug, whether it's intended or not it bothers me so much that i have to deal with this. I have an iSCSI DISK attached to my win 10 workstation. If i copy huge files from the PC to the iSCSI disk it will fill up the RAM of the server to the point where it remains 0 KB left and the system restarts. I think it's a memory allocation bug that needs to be looked into, because the ZFS cache cannot be more than the entire RAM!! Also i'm running a VM so the services take up some memory, but not all, it should be enough. As for the iSCSI disk creation i followed this video: https://www.youtube.com/watch?v=9JL-RVUHj6o

ZFS_cache.png
 

samarium

Contributor
Joined
Apr 8, 2023
Messages
192
You can tune zfs_arc_max, but you will need to search for the details for Core.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Please provide your full hardware list as well as your OS version.
Following YouTube videos is known to cause issues: I am more likely to believe a configuration error than a memory handling error on CORE releases.
 
Joined
Oct 22, 2019
Messages
3,641
Did you disable swap by any chance?
Code:
swapinfo -g
 

Kannderni

Dabbler
Joined
Oct 26, 2021
Messages
25
I think the main problem is that the system doesn't have enough RAM for iSCSI. It worked great for more than 2 years now only having problems when copying data to the iSCSI disk or rather copying from the disk to the disk, maybe that consumes more memory? I'm running the older core version of TrueNAS-12.0-U8.1, and want to upgrade, but first i want to try out this tunable. But i don't know if the value is in KiB or MiB or some other. I want to limit it max 6GB of RAM usage.
tunable.png
 

Kannderni

Dabbler
Joined
Oct 26, 2021
Messages
25
Did you disable swap by any chance?
Code:
swapinfo -g
according to top i have 2048 of swap total and the swapinfo is telling me the same that is using 0% capacity
Device 1G-blocks Used Avail Capacity /dev/mirror/swap0.eli 2 0 2 0%
 
Joined
Oct 22, 2019
Messages
3,641
But i don't know if the value is in KiB or MiB or some other. I want to limit it max 6GB of RAM usage.
It takes a value in "bytes".

I would be weary about tweaking this value.
 

Kannderni

Dabbler
Joined
Oct 26, 2021
Messages
25
I don't think it's a hardware problem, but maybe the PSU isn't good. I highly doubt that the corsair cv450 is the problem here. Maybe the boot hdd is the problem because it's an old WD with lots of on hours. So 6442450944 in bytes is the correct value?
 
Joined
Oct 22, 2019
Messages
3,641
So 6442450944 in bytes is the correct value?
That would be 6 GiB.

Keep in mind in order to revert this value to its default (after you apply the change), you'll need to remove the custom tunable and reboot.
 

Kannderni

Dabbler
Joined
Oct 26, 2021
Messages
25
Also sometimes the system freezes but that is rare maybe once or twice a year and only a hard reboot fixes it.
 

Kannderni

Dabbler
Joined
Oct 26, 2021
Messages
25
That would be 6 GiB.

Keep in mind in order to revert this value to its default (after you apply the change), you'll need to remove the custom tunable and reboot.
The ram should be calculated in GiB (with the power of 2, not the power of 10)?
 

Kannderni

Dabbler
Joined
Oct 26, 2021
Messages
25
It did work, but now the services occupy the RAM, so the problem is with the amount of RAM available to the system.
tunable1.png
 
Top