From my knowledge of MicroPython that array is actually 4X larger than you think since each number is stored in 4 bytes. Then, MP will allocate a new array on the += and another new array on the += again. Your script takes space too in RAM when it’s parsed into a byte array.
…
This seems to work on my M7:
import gc
print('Used: ' + str(gc.mem_alloc()) + ' Free: ' + str(gc.mem_free()))
dotStarPrefix = [0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A]
print('Used: ' + str(gc.mem_alloc()) + ' Free: ' + str(gc.mem_free()))
dotStarWhite = [0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A,\
0xFF,0x0F,0x0F,0x0A]
print('Used: ' + str(gc.mem_alloc()) + ' Free: ' + str(gc.mem_free()))
illuminatorWhite = dotStarPrefix
print('Used: ' + str(gc.mem_alloc()) + ' Free: ' + str(gc.mem_free()))
illuminatorWhite += bytes(dotStarWhite)
print('Used: ' + str(gc.mem_alloc()) + ' Free: ' + str(gc.mem_free()))
illuminatorWhite += dotStarPrefix
print('Used: ' + str(gc.mem_alloc()) + ' Free: ' + str(gc.mem_free()))
print(illuminatorWhite[0])
print('Used: ' + str(gc.mem_alloc()) + ' Free: ' + str(gc.mem_free()))
It prints:
Used: 3072 Free: 52816
Used: 3440 Free: 52448
Used: 3792 Free: 52096
Used: 4000 Free: 51888
Used: 4432 Free: 51456
Used: 4928 Free: 50960
255
Used: 5120 Free: 50768