Davidelvig
Well-known member
How can I assess available memory on a Teensy 3.6? (and other Teensy versions)
If there are different "kinds of memory" that matter (e.g stack, heap) it would be good to know how to measure their availability.
I'm assuming I'm running out of "heap" space.
I've tried RamMonitorExample.ino, and it runs, but seems to be specific to Teensy 3.2 and below.
https://forum.pjrc.com/threads/32401-Memory-Status-and-Monitoring?highlight=rammonitor
If this is an easy answer, please point me to the method call documentation.
If not, I can post a test app the demonstrates the problem. (at the moment, it's a large app that demonstrated the issue... I'll need to untangle it).
My case now: creating a linked list of MIDI messages (objects) from a MIFI file.
My class for the message objects is currently defined as follows:
at compile time, memory usage appears as...
If there are different "kinds of memory" that matter (e.g stack, heap) it would be good to know how to measure their availability.
I'm assuming I'm running out of "heap" space.
I've tried RamMonitorExample.ino, and it runs, but seems to be specific to Teensy 3.2 and below.
https://forum.pjrc.com/threads/32401-Memory-Status-and-Monitoring?highlight=rammonitor
If this is an easy answer, please point me to the method call documentation.
If not, I can post a test app the demonstrates the problem. (at the moment, it's a large app that demonstrated the issue... I'll need to untangle it).
My case now: creating a linked list of MIDI messages (objects) from a MIFI file.
My class for the message objects is currently defined as follows:
Code:
class midiMessage {
public:
midiMessage(File *f, midiMessage *prev);
void playMessage(void);
void displayMessage(void);
long getVarLenQuant(File *f, int *byteCount);
midiMessage *_prevMessage = NULL,
*_nextMessage = NULL;
unsigned long timeFromStart = 0;
unsigned long deltaTime = 0;
unsigned char wholeMessageType = 0;
unsigned char messageType = 0;
unsigned char msgSubType = 0;
unsigned long sysExLength = 0;
unsigned char metaEventType = 0;
unsigned char channel;
int fullMessageLength = 0;
bool isRunningMessage = false;
unsigned char val1 = 0,
val2 = 0;
private:
};
at compile time, memory usage appears as...
Sketch uses 69864 bytes (6%) of program storage space. Maximum is 1048576 bytes.
Global variables use 26512 bytes (10%) of dynamic memory, leaving 235632 bytes for local variables. Maximum is 262144 bytes.
Last edited: