From 0d221775f5ab458358ee873b70ad16f284a9b1cb Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 23 Jul 2016 13:56:24 +0300 Subject: [PATCH] esp8266/_boot.py: Decrease GC alloc threshold to quarter of heap size. The idea behind decrease is: bytecode and other static data is also kept on heap, and can easily become half of heap, then setting threshold to half of heap will have null effect - GC will happen on complete heap exhaustion like before. But exactly in such config maintaining heap defragmented is very important, so lower threshold to accommodate that. --- esp8266/modules/_boot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp8266/modules/_boot.py b/esp8266/modules/_boot.py index ed43c0b3df..c200b3d3f9 100644 --- a/esp8266/modules/_boot.py +++ b/esp8266/modules/_boot.py @@ -1,5 +1,5 @@ import gc -gc.threshold((gc.mem_free() + gc.mem_alloc()) // 2) +gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4) import uos from flashbdev import bdev