Photon running out of RAM?

Hi all

I’ve just finished up working on a display driver for the Newhaven SSD1325 display.
It works great with the Adafruit GFX library however, due to the size of the memory buffer I think I may be running out of RAM now that I’ve added additional functions.
This problem has likely come about because the display requires a 4096 byte buffer. (Each byte addresses 2 pixels, 16 levels of brightness each.) Unlike the SSD1306 which I believe stores 8 pixels per byte.
Now I’m not exactly sure that I have run out of RAM, but at times, the Photon flashes red straight after programming and then resets itself (this happens in a loop until I restart in safe mode). Does this sound like a RAM issue?
So I suppose I’ve got two questions, is there a way that I can tell how much RAM I’m using, and is the next firmware build likely to free up any more RAM?

Cheers

The firmware starts with around 70K of free RAM. In 0.4.4, there is a new firmware API

uint32_t freemem = System.freeMemory();

that you can use to determine if the system is running out of memory.

3 Likes

Thanks @mdma, really appreciate you going through all these old questions! Hope you had a good vacation!