Page 1 of 1

linker error: DRAM overflow

Posted: Wed Nov 06, 2019 1:26 pm
by greengnu
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?

Re: linker error: DRAM overflow

Posted: Thu Nov 07, 2019 4:06 am
by ESP_Sprite
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.