Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

malloc size limit

Altera_Forum
Honored Contributor II
968 Views

Hi, 

 

on my board I've more than 8000 KB of free RAM. 

From my application I try to malloc a big buffer in RAM, ~5000KB, but I see that the malloc function don't give me this memory space. 

 

I made some test and I've seen that the maximal block of memory that I can to alloc is  

~4194055 Bytes. 

 

Why? Is there an allocation limit? 

 

Can somebody help me? 

 

thanks 

StePa
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
269 Views

There is no MMU support here. 

Even you have a lot free memory, they may be fragmented. 

You should allocate in smaller chunks, and make a list of them.
0 Kudos
Altera_Forum
Honored Contributor II
269 Views

Thanks hippo, 

 

I've tried to malloc in smaller blocks. It's work better, but I see that if the malloc failed, after some tries the kernel kill my application. 

 

How do I have to set the overcommit_memory and overcommit_ratio in 

/proc/sys/vm ? 

 

Which other kernel parameter have I to set, so that my system works properly, and to avoid that my applications are killed from the OOM_KILLER? 

 

Can somebody help me? 

 

thanks 

StePa
0 Kudos
Altera_Forum
Honored Contributor II
269 Views

 

--- Quote Start ---  

originally posted by stepa@Dec 6 2005, 02:31 AM 

thanks hippo, 

 

i've tried to malloc in smaller blocks. it's work better, but i see that if the malloc failed, after some tries the kernel kill my application. 

 

how do i have to set the overcommit_memory and overcommit_ratio in 

/proc/sys/vm ? 

 

which other kernel parameter have i to set, so that my system works properly, and to avoid that my applications are killed from the oom_killer? 

 

can somebody help me? 

 

thanks 

stepa 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11342) 

--- quote end ---  

 

--- Quote End ---  

 

 

not sure if this is related, but there is a parameter in the kernel configure menu that allows the allocation of &#39;large&#39; blocks of memory - make sure that is on.
0 Kudos
Reply