What's new

AX86u - Problem with samba Memory allocation error

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Caspi

New Around Here
Hi
I use cobian reflector to copy all files from local disk to disk attached to the router. I use samba to this v2.
It tooks usually few hours to finish this tasks when full copy is made and I copy about 50-90GB of data. Unfortunatelly I get from time to time error which casues that some of backuped files are not copied.
Can somebody help me to solve this issue. I have newest Merlin firmware. Below syslog


Code:
Mar 27 08:36:30 smbd[5194]: [2023/03/27 08:36:30.478160,  0] lib/util.c:757(Realloc)
Mar 27 08:36:30 smbd[5194]:   Memory allocation error: failed to expand to 69632 bytes
Mar 27 09:30:13 smbd[13837]: [2023/03/27 09:30:13.554683,  0] lib/util.c:757(Realloc)
Mar 27 09:30:13 smbd[13837]:   Memory allocation error: failed to expand to 69632 bytes
Mar 27 09:30:13 smbd[13837]: [2023/03/27 09:30:13.599265,  0] lib/util.c:757(Realloc)
Mar 27 09:30:13 smbd[13837]:   Memory allocation error: failed to expand to 69632 bytes
Mar 27 09:30:13 out of memory [13837]
Mar 27 09:30:13 out of memory [13837]
Mar 27 09:30:13 out of memory [13837]
Mar 27 09:30:13 out of memory [13837]
Mar 27 09:30:13 out of memory [13837]
Mar 27 09:30:13 out of memory [13837]
Mar 27 09:40:20 smbd[22297]: [2023/03/27 09:40:20.043032,  0] lib/util.c:757(Realloc)
Mar 27 09:40:20 smbd[22297]:   Memory allocation error: failed to expand to 69632 bytes
Mar 27 09:40:20 smbd[22297]: [2023/03/27 09:40:20.083077,  0] lib/util.c:757(Realloc)
Mar 27 09:40:20 smbd[22297]:   Memory allocation error: failed to expand to 69632 bytes
Mar 27 09:40:20 out of memory [22297]
Mar 27 09:40:20 out of memory [22297]
Mar 27 09:40:20 out of memory [22297]
Mar 27 09:40:20 out of memory [22297]
Mar 27 09:40:20 out of memory [22297]
Mar 27 09:40:20 out of memory [22297]
Mar 27 09:56:18 smbd[23944]: [2023/03/27 09:56:18.375210,  0] lib/util.c:757(Realloc)
Mar 27 09:56:18 smbd[23944]:   Memory allocation error: failed to expand to 69632 bytes
Mar 27 09:56:18 smbd[23944]: [2023/03/27 09:56:18.420799,  0] lib/util.c:757(Realloc)
Mar 27 09:56:18 smbd[23944]:   Memory allocation error: failed to expand to 69632 bytes
Mar 27 09:56:18 smbd[23944]: [2023/03/27 09:56:18.465886,  0] lib/util.c:757(Realloc)
Mar 27 09:56:18 smbd[23944]:   Memory allocation error: failed to expand to 69632 bytes
Mar 27 09:56:18 smbd[23944]: [2023/03/27 09:56:18.471975,  0] lib/util.c:1116(smb_panic)
Mar 27 09:56:18 out of memory [23944]
Mar 27 09:56:18 out of memory [23944]
Mar 27 09:56:18 out of memory [23944]
Mar 27 09:56:18 out of memory [23944]
Mar 27 09:56:18 out of memory [23944]
 
First, using a router for a NAS is not a great idea. Especially for large file transfers.
The external drive needs to be powered by its own power supply and not the router.
To help with memory add a thumb drive and put a swap file on it. The swap file should be equal to the router RAM.
 
Swap on USB won't help, it's useless. @Caspi is experiencing widely unrecognized, but common issue on Asus routers. I personally can crash any Asus router with specific file transfer no matter if there is swap configured or not. They just run out of RAM perhaps due to poorly implemented Samba.
 
Swap on USB won't help, it's useless. @Caspi is experiencing widely unrecognized, but common issue on Asus routers. I personally can crash any Asus router with specific file transfer no matter if there is swap configured or not. They just run out of RAM perhaps due to poorly implemented Samba.

Likely not just Asus, however we see more reports as there is a sizable Asus user base here on SNB.

Sambe is memory intensive, and as OP mentions, sometimes it will run out of memory on small footprint devices.

I would suggest perhaps using a single or two bay NAS, and move the activity over to it - they're purpose built and optimized, and as @bbunge and other mention, a router is not an ideal solution for what @Caspi is trying to do.

A low end NAS is a bit of a spent, but data loss has a price that is likely many times over what a NAS would cost.

Synology, QNAP, Asustor all have NAS boxes that are reasonably priced.
 
Unfortunately, I think I have to confirm your observations. The previous router I had, AC-88U, also had problems, but I still think that this feature worked before. I was hoping that the higher-end router AX86U would handle Samba better.
I agree that a NAS is a better solution, but I chose a router because:
  • there's no noisy fan
  • I have all the configuration in one place
  • I don't lose one LAN port for connecting NAS
  • I don't need anything more than Samba.
I also think NAS servers do not have more powerful components than good routers, so I think that the router should also be able to handle samba
I tested also the beta firmware 9.x.x.x from Asus but the error persists. Probably I will return the router and switch back to my old AC88U and purchase a Synology NAS server ds220j.
 
Last edited:
Unfortunately, I think I have to confirm your observations. The previous router I had, AC-88U, also had problems, but I still think that this feature worked before. I was hoping that the higher-end router AX86U would handle Samba better.

Ditto.

I never had any issues with the file share feature on my AC56U up to, and including the 382 branch. It had what, 256MB of RAM, a quarter of the AX86U? And never ran close to maxing that out, under the same usage (10 clients, no VPN, mostly default settings).

With the AX86U, and the same drive, SMB is unreliable, and it's not unusual to discover that files that didn't successfully write to the drive, with zero bytes.

If they're not going to fix it, they should just remove the feature.
 
Ditto.

I never had any issues with the file share feature on my AC56U up to, and including the 382 branch.
I confirm. The AC56U router was my first ASUS router and it worked without any issues. I guess it could be because the transfers were much slower than in the current generation of hardware. The problem I described also doesn't occur always, but only after 2 or 3 hours of continuous data transmission. Maybe in combination with the transfer speed, this causes the router to struggle.
Maybe it is time to change router's brand...
 
Every time I mention the issue there is someone saying has no issues. So use what you can the way you can. If it doesn’t work for you - look for better alternatives. There are many mostly marketing purpose features in home routers and Asuswrt in particular. My ISP provided modem/router doesn’t crash with Samba transfers.
 
Every time I mention the issue there is someone saying has no issues. So use what you can the way you can. If it doesn’t work for you - look for better alternatives. There are many mostly marketing purpose features in home routers and Asuswrt in particular. My ISP provided modem/router doesn’t crash with Samba transfers.
Right... No issues with SMB... maybe some other factor?

This morning I hauled out my old USB2 powered enclosure with a 1 TB WD Green drive. Hooked it up to the trusty AX86U, formatted the drive with the router to NTFS and began a transfer over Ethernet with a 70 GB batch of files (largest over 4 GB). Then I started a 30 GB transfer over WIFI to the same drive but different folder. AX86U RAM went to 97% and stayed there. Meanwhile, the family continued to use the internet connection with no complaints. Both transfers finished successfully. Unmounted the drive and unplugged it from the router. RAM usage went back to 56%.

I have my USB ports set to USB2 and avoid using USB3 drives in the router. I feel that USB3 use can impinge on the 2.4 GHz operation.

Keep in mind that this was a test and only a test. Your results may vary and I still do not recommend using a router to store files. A NAS does a much better job...
 

I tried both a metal USB drive as well as a SSD in a metal case. In my case setting the port to USB2 did not fix the error issues, it only slowed down the transfer speed. Meanwhile the USB drive in in my WIN10 TV computer (USB3) is working fine but slower than in the RT-AX88U. But in fairness temporarily it's connected by AIMESH with a 5G backbone till I get the wiring fixed. I may indeed also get a new NAS someday but currently Uncles Sam wants his money. ;>(
 
I am using an ac86u, and an ac68. I also have the same failed transfers with large files when I try with each. After about an hour, windows reports a failure.
I'm wondering if this is a software or hardware issue?

For troubleshooting, has anyone tried the same transfers on these routers if they are flashed to alternative firmware like freshtomato? I think the ac68 is supported but not the ac86? I personally haven't done this, but wonder if anyone has.

I wish the samba thing would be fixed, as its a total pain.

Are there any recommended and verified routers that handle samba well?

Thanks
 
Synology, QNAP, Asustor all have NAS boxes that are reasonably priced.
Beside my main NAS (a QNAP TS-464), I use a low-end QNAP TS-228A to handle storing backups. Pretty affordable dual bay NAS, well suited for that type of use.
 
Are there any recommended and verified routers that handle samba well?
Routers will never handle samba "well". Low memory, entry level USB controller (versus a NAS's SATA), old Samba version (due to lack of flash space to handle Samba 4's mammoth size). And the major security flaw that you are exposing all of that disk's data on your primary firewall device. It's like leaving your jewelry by the window.
 
There's also a Windows bug (supposedly fixed but later acknowledged not totally fixed) that contributes to this problem: https://www.bleepingcomputer.com/ne...es-windows-11-slow-file-copy-issues-over-smb/

Check the Samba windows event logs and you'll see periodic samba disconnects when copy large files from router USB., such as my 86U.

This only happens with fast connections, ie. transferring from 86U USB at ~100Mbs via gigabit LAN. No problems at ~55Mbs AX connection. I{ think the 86U just gets overwhelmed at 100Mbps despite just one of the four CPU's pegged at 100% usage.
 
Routers will never handle samba "well". Low memory, entry level USB controller (versus a NAS's SATA), old Samba version (due to lack of flash space to handle Samba 4's mammoth size). And the major security flaw that you are exposing all of that disk's data on your primary firewall device. It's like leaving your jewelry by the window.
Thank you. I understand what you mean by "never handle samba well". I was just hoping to not have it error out, for the times I do use it.
Do you have a suspicion why it fails so consistently with long file transfers? I've seen people report that other routers don't have that issue, so just curious why given that most probably have the same limitations of "low memory, entry level usb...", etc.

I appreciate your taking the time to respond previously. I'm going to scout for a good price on a cheap NAS.
 
Last edited:
Do you have a suspicion why it fails so consistently with long file transfers?
No idea. If buffers are using up RAM, I would expect buffers to get flushed rather than having the program completely fail with an OOM error. Could be an issue with the old Samba version, I don't know.
 
I'm new here. From one past post to multiple threads it now appears I'm not the only one having this issue. And not really an issue as I have stopped using SMB on the router. I feel bad reposting from other threads and I am having a hard time remembering where I said what to avoid repeating . So how does someone start a new thread and not loose the other valid replies?

SteverinoLA


I'm actually running Windows 10 but I cannot count the times that past Windows updates or their past software depreciations for "MY BENENIFT" has cause my working computer systems to require fixing.

 
Last edited:
I have for test Synology cheap NAS ds120j it has less ram than my AX86u and poor CPU but it handles smb correctly. So I think there is a problem with smb implementation on Asus.
I would like to stay with this NAS but it has problem with disk hibernation and is too loud during the night.

Somebody has asked about alternative firmware. I've tested router on merlin firmware, stock firmware and stock beta firmware and problem exists on all of them.
 
Last edited:

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top