Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Failure to allocate memory

I've got a 2.6.16 based uClinux Kernel running on my Nios2 custom hardware. I've compiled "telnetd" into Busybox and Dropbear SSH. I've tried to bring down the size of the Kernel to as little as possible by removing all unnecessary options.

However, the moment I either run Dropbear or use the inbuilt Telnet server in Busybox, I get the familiar memory allocation failed messages.

# id: page allocation failure. order:8, mode:0xd0
Call Trace:
Mem-info:
DMA per-cpu:
cpu 0 hot: high 0, batch 1 used:0
cpu 0 cold: high 0, batch 1 used:0
DMA32 per-cpu: empty
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages:        1220kB (0kB HighMem)
Active:113 inactive:179 dirty:0 writeback:0 unstable:0 free:305 slab:3025 mapped:0 pagetables:0
DMA free:1220kB min:512kB low:640kB high:768kB active:452kB inactive:716kB present:16384kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve: 0 0 0 0
DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve: 0 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve: 0 0 0 0
HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve: 0 0 0 0
DMA: 7*4kB 9*8kB 4*16kB 3*32kB 1*64kB 1*128kB 1*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 1220kB
DMA32: empty
Normal: empty
HighMem: empty
4096 pages of RAM
305 free pages
406 reserved pages
0 pages shared
0 pages swap cached
Allocation of length 608787 from process 78 failed
DMA per-cpu:
cpu 0 hot: high 0, batch 1 used:0
cpu 0 cold: high 0, batch 1 used:0
DMA32 per-cpu: empty
Normal per-cpu: empty
HighMem per-cpu: empty

Doing "free -m" before trying to telnet shows that I should have enough memory for any allocation that Busybox might do.

# free -m
MemTotal:        14760 kB
MemFree:          3356 kB
Buffers:             0 kB

I initially had Busybox's stack pegged at the default 16k, but upped it to 32k with no change in behaviour.

busybox
    Magic:        bFLT
    Rev:          4
    Build Date:   Tue Dec 12 16:50:46 2006
    Entry:        0x40
    Data Start:   0x5c7c4
    Data End:     0x70544
    BSS End:      0x8cc18
    Stack Size:   0x7d00
    Reloc Start:  0x70544
    Reloc Count:  0x2fe1
    Flags:        0x1 ( Load-to-Ram )

I'd appreciate any thoughts and suggestions.

Regards

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Turns out that it was just an issue of really running out of memory. We have a custom application running on this board that was taking up too much memory. I recompiled the latest netkit-telnet and compressed it with "flthdr -z" and it managed to load within the available memory.

    So I'm all set...

    Regards
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you use server in busybox, it will take up a lot of memory.

    You should use stand-alone servers.

    If you use the simple init and sash in uClinux-dist, you will have more memory available than using all in busybox.