linker error: DRAM overflow

greengnu
Posts: 27
Joined: Wed May 08, 2019 8:45 pm

linker error: DRAM overflow

Postby greengnu » Wed Nov 06, 2019 1:26 pm

Currently while linking (in platformIO), I'm getting the following linker errors:

Code: Select all

ld.exe: .pio\build\esp32cam\firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
ld.exe: DRAM segment data does not fit.
ld.exe: region `dram0_0_seg' overflowed by 469400 bytes
From reading some otherr threads, it seems that this happens if the code somewhere mallocs too many bytes (please correct me).

My questions though:
1. How can this even be determined during linking whether the allocation is too big?
2. Why is this an error? afaik trying to malloc too much memory is perfectly fine and one just gets back a nullptr, no?

ESP_Sprite
Posts: 9014
Joined: Thu Nov 26, 2015 4:08 am

Re: linker error: DRAM overflow

Postby ESP_Sprite » Thu Nov 07, 2019 4:06 am

This has nothing to do with malloc, as as you said the code behaviour calling that isn't known at linker time. It's usually because you use up too much memory with static variables.

Who is online

Users browsing this forum: Cemal5454 and 112 guests