← index #3138Issue #6245
Related · medium · value 0.289
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

gc_alloc_amount value not subtract by gc_free

closedby zxc199108opened 2020-07-15updated 2020-07-20
py-core

I find gc_alloc_amount just clear by gc_collect but,not subtract when gc_free. so the gc_alloc_amount is not accuracy. I suggest when MICROPY_GC_ALLOC_THRESHOLD == 1 ,we can compute gc_alloc_amount at gc_free.

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