Skip to content

Commit 686367d

Browse files
committed
esp8266: Explicitly collect garbage in bootstrap scripts.
Leads to less fragmentation at teh time user code starts.
1 parent 417dc0c commit 686367d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

esp8266/modules/_boot.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import gc
12
import uos
23
from flashbdev import bdev
34

@@ -7,3 +8,5 @@
78
except OSError:
89
import inisetup
910
vfs = inisetup.setup()
11+
12+
gc.collect()

esp8266/scripts/inisetup.py

+2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def setup():
4040
with open("/boot.py", "w") as f:
4141
f.write("""\
4242
# This file is executed on every boot (including wake-boot from deepsleep)
43+
import gc
4344
#import webrepl
4445
#webrepl.start()
46+
gc.collect()
4547
""")
4648
return vfs

0 commit comments

Comments
 (0)