Questions tagged [memory-usage]
Use this tag for questions about memory usage on the Arduino.
148 questions
1
vote
2
answers
4k
views
Serial printing from flash memory (F() macro, PROGMEM, sprintf_P, SPTR)
I have been testing various techniques on an Arduino Uno for serial printing from flash memory instead of RAM. At the same time, I have been using the freeMemory() function from Adafruit.
I created a ...
7
votes
1
answer
12k
views
Store String using F() Macro
I'm new to the Arduino and do not quite understand the F() macro yet.
In my code, I have a String, and as I want to transfer it via WebServer, I need to write it to the answer.
Somehow I need to ...
1
vote
0
answers
117
views
"Stack canary watchpoint triggered (loopTask)" when synchronizing with Arduino Cloud IoT (ArduinoCloud.update())
I have created a sketch that updates 195 variables : 16xString variables, 34xfloat, 52xint, 107xbool.
Notice : I'm using the IDE tool instead of the included Cloud IoT compile (because I have a pb ...
-1
votes
2
answers
268
views
How can I make this program take up less memory?
I'm measuring how long it takes to drain a battery. An Arduino Nano controls an SSD1036 OLED display, a board with two relays, and an INA3221 voltage/current measurement board.
The battery is ...
0
votes
1
answer
92
views
How can I make this function take up less memory? [duplicate]
I've written a sketch that uses TimeLib to display elapsed time. I'm measuring how long it takes to drain a battery. The goal is to display the time as hh:mm:ss.
The code I use works well when I ...
-1
votes
1
answer
136
views
Help reducing dynamic memory usage with LoRa library
I have combined code that reads heart rate and SPO2 then sends the data using LoRaWAN. Using these 2 libraries that work well by themselves LoraWAN lib | MAX30102 lib. My board is an Arduino Pro or ...
0
votes
1
answer
122
views
Problem with char* variable malloc/free. Empty contents on recipient variable after using free
I am working on a custom SD card data logger using the following function and struct:
char *filenameCreator(const char *prefix, const char *num, bool addExtension)
{
char *filename = (char *)...
0
votes
1
answer
197
views
deserializeJson() failed: NoMemory when sending Serial json using ArduinoJson
Hey all I have a sketch that takes up 99% of my storage space since I am using a Arduino Nano.
Although everything in my code fits as-is, there seems to be an issue with me sending a json string over ...
2
votes
2
answers
8k
views
How to clear heap memory in ESP32?
I am using Free RTOS on ESP32 in my program. However at some point of time when I execute xTaskCreate() it returns -1 , the error being could_not_allocate_required_memory. In my program, each time I ...
0
votes
2
answers
134
views
Is it "safe" to use "new" keyword to instantize several sensor objects?
I've read that it is bad practice to use dynamic memory allocations on a microcontroller and I have a pretty good grasp of why.
I am developing a custom PCB around an ATMega2560 and in my situation, I ...
0
votes
1
answer
241
views
Memory usage in AnalogBinLogger of SdFat library
The AnalogBinLogger.ino file of SdFat library says the following:
Each 512 byte data block in the file has a four byte header followed by up to 508 bytes of data. (508 values in 8-bit mode or 254 ...
4
votes
3
answers
7k
views
Is there any way I can connect the RAM of a computer to Arduino?
I was thinking about a way to reuse the RAM of my old computer on my Arduino board. I was thinking about some peojects using neural networks, and more RAM would let the Arduino use more neurons.
So ...
6
votes
1
answer
752
views
Understanding global variables on Arduino
I am rewriting a set of LED manipulation functions to be more object oriented, and I have found that, mysteriously, my global variable memory space has been over consumed, despite a reduction of the ...
1
vote
1
answer
280
views
Conditional assignment of array
I have some really long global variable arrays filled with data.
There is a single function that processes the data. The function works on only one array everytime. This arrays value changes every ...
1
vote
1
answer
356
views
Why does Serial.print(1) cost 228 bytes more program memory compared to Serial.print((char)(48+1))?
Just discovered this. When I cast an int to a char inside a Serial.print statement it costs way less program memory. I'm not sure why. Could someone explain this to me?
In the following example the ...