← index #3138Issue #3840
Related · high · value 1.283
QUERY · ISSUE

gc threshold calculation in docs/reference/constrained

openby peterhinchopened 2017-06-11updated 2017-07-02
docs

This has

gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)

which sets the threshold to 1/4 of the total RAM regardless of the amount allocated. Shouldn't this read

gc.threshold(gc.mem_free() // 4 + gc.mem_alloc())

to account for RAM already allocated?

CANDIDATE · ISSUE

ESP32: no default gc threshold

openby miketeachmanopened 2018-06-05updated 2024-09-29
enhancementport-esp32

Latest stable firmware (esp32-20180511-v1.9.4.bin) does not appear to have a garbage collection threshold. running gc.threshold() in the REPL returns -1. gc.isenabled() returns True. Running in a loop will take the free heap space to zero, with no automatic gc.

Is there a reason for this default configuration? The esp8266 has an out-of-the-box gc threshold of 8992.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied