Not enough memory in noMMU UcLinux on STM32f769

Hello,

I'm trying to run noMMU UcLinux buildroot based distribution on STM32F769 (cortex m7) platform with 16MB of RAM.

It seems that at the end, there is over 4MB of free memory but it seems like grouped in a lot of smaller chunks instead of few bigger.

When I run some bigger compiled binaries in flat format, I get segfaults, because memory cannot be allocated to start the app.

I'm getting similar errors on strace, openssl, mosquito, (and it seems on any bigger app):

nommu: Allocation of length 1728512 from process 60 (openssl) failed
active_anon:0 inactive_anon:0 isolated_anon:0
active_file:3 inactive_file:11 isolated_file:0
unevictable:202 dirty:0 writeback:0 unstable:0
slab_reclaimable:0 slab_unreclaimable:805
mapped:0 shmem:0 pagetables:0 bounce:0
free:1154 free_pcp:0 free_cma:0
Node 0 active_anon:0kB inactive_anon:0kB active_file:12kB inactive_file:44kB unevictable:808kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
Normal free:4616kB min:432kB low:540kB high:648kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:12kB inactive_file:44kB unevictable:808kB writepending:0kB present:15296kB managed:11864kB mlocked:0kB kernel_stack:264kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
lowmem_reserve[]: 0 0
Normal: 18*4kB (UM) 20*8kB (UM) 10*16kB (UM) 10*32kB (UM) 13*64kB (UM) 8*128kB (UM) 4*256kB (UM) 2*512kB (M) 0*1024kB 0*2048kB 0*4096kB = 4616kB
216 total pagecache pages
binfmt_flat: Unable to allocate RAM for process text/data, errno –12

I'm not sure if I understand right, but last line explains allocation possibilities available. 

Normal: 18*4kB (UM) 20*8kB (UM) 10*16kB (UM) 10*32kB (UM) 13*64kB (UM) 8*128kB (UM) 4*256kB (UM) 2*512kB (M) 0*1024kB 0*2048kB 0*4096kB = 4616kB

It seems that there is enough memory, but I don't understand why it is  so fragmented and grouped in many smaller chunks.

Does this come as a consequence of memory fragmentation and cannot be improved ?

Or is there any possibility to get bigger available chunks of memory, so my binary will be able to come into memory to execute without segfaults ? I remember that older kernels had BIGALLOCS config option, but it seems not present anymore.

Any advice, experience, examples or docs to learn from ?

Thanks in advance,

regards,

Rob.