Forum Discussion

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

error : memory exhausted

When I try to run my application I get "memory exhausted" message. I have passed "mem = 32M" as kernel parameter to increase the ram allocation to kernel to 32 MB. But it still doesn't work.

4 Replies

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

    You don't need to give "mem=xxx" to kernel. The nios2 arch setup.c will use all sdram.

    Please check available memory before your application, with "free" or "cat /proc/meminfo".

    You should also check memory required by your application.

    The error may also come from corrupted memory.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hippo,

    My application uses non padded buffers of total size 2 MB. I have 32 MB RAM on baord and when i use free i see about 25 MB if free. My application works fine when i use non padded buffers but when i try to run the same with padded buffers it gives me "Memory Exhausted" error.

    When i say buffer i am referring to structures.

    What could be the problem?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I don't understand your problem about padding.

    One important difference between RISC and x86 is that RISC can not access unaligned word.

    eg, read 32 bits word from address 4 is OK, but read 32 bits word from address 5,6,7 is wrong.

    so you may need to 4 read bytes from address 9, and shifted to make a 32 bit word.

    This applies when you read or write a unaligned member in a structure.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello hippo ,

    I've read this post. And even when it is a little old, I have the same problem. You mentioned something about corrupted memory. Is there a way to read from the memory or verify that it is not corrupted? I'm getting the same memory exhausted message.

    Regards,

    Francisco