Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional errors "rt_build: if_initrt: Cannot allocate memory" on idle machines with enough memory #466

Closed
liweitianux opened this issue Feb 17, 2025 · 3 comments

Comments

@liweitianux
Copy link

Hi all,

I have two DragonFly machines running dhcpcd, and they occasionally emit errors rt_build: if_initrt: Cannot allocate memory. However, I don't believe the machines were actually lacking memory. One machine is bare metal with 8G RAM and 16G swap, and the swap was almost unused (only 16M in use). The other machine is a VirtualBox VM with 2G RAM and 2G swap; it was just idle and used no swap.

On the bare metal machine:

% grep if_initrt /var/log/messages
Dec 14 11:40:27 microserver dhcpcd[428]: rt_build: if_initrt: Cannot allocate memory
Dec 14 19:33:28 microserver dhcpcd[428]: rt_build: if_initrt: Cannot allocate memory
Feb  8 17:36:54 microserver dhcpcd[428]: rt_build: if_initrt: Cannot allocate memory
Feb 11 18:07:30 microserver dhcpcd[428]: rt_build: if_initrt: Cannot allocate memory

On the VM:

% grep if_initrt /var/log/messages
Feb 15 23:33:26 dfly dhcpcd[426]: rt_build: if_initrt: Cannot allocate memory

I'll keep monitoring this and hope to get more details.

@rsmarples
Copy link
Member

rsmarples commented Feb 18, 2025

We need to check if-bsd.c in the if_initrt function and see how much memory the kernel wants us to allocate to receive the route messages.

@rsmarples
Copy link
Member

I have seen this once when working the kernel rtsock netmask patch.

@liweitianux
Copy link
Author

Nice catch. Awesome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants