Thundercat
Well-known member
Hi all,
I've got a gigantic sketch over 30,000 lines of code in a Teensy 4.0. As might be expected I'm running out of memory for files, to the point I'm getting concerned I can continue development of the product using the sketch.
Of course I've moved large arrays into DMAMEM, but I still need more room.
Here's the most recent build results, using the "Fast" option in the compiler:
Opening Teensy Loader...
Memory Usage on Teensy 4.0:
FLASH: code:358632, data:1628768, headers:8984 free for files:35232
RAM1: variables:49856, code:356832, padding:3616 free for local variables:113984
RAM2: variables:21312 free for malloc/new:502976
I only have a few small images in the sketch, so besides the size of the code itself, what's eating the memory are the many fonts I've loaded. And yes I've reduced them as much as I can, but I can only reduce them so much.
What I'm wondering is, how can I move, for example, fonts into another area to maximize file usage? Could fonts be put into DMAMEM?
Sorry if this is an easy question; I'm trying to wrap my head around the memory system here and how to manage it better.
FYI I loaded the sketch into a Teensy 4.1 and still had same issue; regardless the 8MB memory size, the file memory was nearly eaten up again mostly by the fonts.
Thanks for any insights.
Mike
PS yes I'm aware I can compile for smallest code size, but I'm still limited here with not enough room leftover for additional development ideas I'd like to implement.
I've got a gigantic sketch over 30,000 lines of code in a Teensy 4.0. As might be expected I'm running out of memory for files, to the point I'm getting concerned I can continue development of the product using the sketch.
Of course I've moved large arrays into DMAMEM, but I still need more room.
Here's the most recent build results, using the "Fast" option in the compiler:
Opening Teensy Loader...
Memory Usage on Teensy 4.0:
FLASH: code:358632, data:1628768, headers:8984 free for files:35232
RAM1: variables:49856, code:356832, padding:3616 free for local variables:113984
RAM2: variables:21312 free for malloc/new:502976
I only have a few small images in the sketch, so besides the size of the code itself, what's eating the memory are the many fonts I've loaded. And yes I've reduced them as much as I can, but I can only reduce them so much.
What I'm wondering is, how can I move, for example, fonts into another area to maximize file usage? Could fonts be put into DMAMEM?
Sorry if this is an easy question; I'm trying to wrap my head around the memory system here and how to manage it better.
FYI I loaded the sketch into a Teensy 4.1 and still had same issue; regardless the 8MB memory size, the file memory was nearly eaten up again mostly by the fonts.
Thanks for any insights.
Mike
PS yes I'm aware I can compile for smallest code size, but I'm still limited here with not enough room leftover for additional development ideas I'd like to implement.