Error on Pro Mini upload...EDIT:- advised just warning not error

Have a program here I have used many times before without problems but today, when I try to upload, I get an error saying “low memory available, stability problems may occur”.

Earlier today I added ATtiny to the boards manager and installed ATTiny drivers so I’m wondering if that has anything to do with it.

Code of my program and the error message below.

/* Arduino program to run UV LEDs Andrew Apel eye specialist....Brisbane
    runTime in minutes is set via the DIP switches as a binary number
    i.e. leftmost switch is digit 16 and rightmost switch is 1 withe other values as below
    e.g. switch bit 4 and switch bit 0 ON = (16 + 1) = 17 minutes

#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;

//U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0);
//U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2 (U8G2_R0, A5, A4);
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

int seconds;          // for Oled display timer showing seconds since start
int minutes;          // for Oled display timer showing minutes since start
int runTime = 0;      // time that is calculated from the DIP switch settings for the UV LEDs to run

int auto_reset = 4;   // pin connected to reset for reset after maximum runtime. Avoids minutes coming around again after 1 hour and turning LEDs back on again

const byte startButton = 2;   // start button starts the timing and turns the LEDs on
const byte mosfet = 3;       // switch for turning UV Leds on and off
unsigned long currentTime;
unsigned long sTime;

void setup(void) {
  pinMode(mosfet, OUTPUT); // configure pin as output for mosfet which drives the Led power to the buck converter

  // DIP switches set the time the UV LEDs will be ON......"runTime"
  pinMode(9, INPUT_PULLUP);     // DIP switch for 1
  pinMode(8, INPUT_PULLUP);     // DIP switch for 2
  pinMode(7, INPUT_PULLUP);     // DIP switch for 4
  pinMode(6, INPUT_PULLUP);     // DIP switch for 8
  pinMode(5, INPUT_PULLUP);     // DIP switch for 16

  pinMode(startButton, INPUT_PULLUP);
  pinMode(mosfet, OUTPUT);

  if (digitalRead(5) == LOW)
    runTime += 16;
  if (digitalRead(6) == LOW)
    runTime += 8;
  if (digitalRead(7) == LOW)
    runTime += 4;
  if (digitalRead(8) == LOW)
    runTime += 2;
  if (digitalRead(9) == LOW)
    runTime += 1;             // DIP switches which determine the runTime

  digitalWrite (auto_reset, HIGH);  // reset pin set to high for normal running
  pinMode(auto_reset, OUTPUT);

  //Serial.begin(9600); // FOR TESTING ONLY***********************************
  // Serial.print ("runTime is set for ");
  // Serial.println(runTime);

  ina219.begin();                      // initialise current sensor
  ina219.setCalibration_16V_400mA();   // recalibrate current sensor to minimise fluctuations under load
  u8g2.begin();                        // initialise Oled display
  u8g2.setCursor(2, 10);
  u8g2.print("TimeSet = ");
  u8g2.print(" mins");
  u8g2.print("Press START");
  //u8g2.setCursor(10, 25);
  //u8g2.print("to run UV LED's");
  while (digitalRead(startButton) == HIGH) {
  currentTime = millis();


void loop() {
  float current_mA = 0;
  sTime = millis() - currentTime;
  seconds = (60 + sTime / 1000) % 60;
  minutes = (60 + sTime / 60000) % 60; // method of getting the time by "remainder"
  u8g2.setCursor (25, 32);

  current_mA = ina219.getCurrent_mA();

  // added this to compensate for fluctuating readout at zero load
  if (current_mA < 1) {
    current_mA = 0;
  u8g2.print (" mA");
  u8g2.setCursor (20, 10);
  u8g2.print (minutes);
  u8g2.print ("m : ");
  if (seconds < 10) u8g2.print ("0");
  u8g2.print (seconds);
  u8g2.print ("s");
  u8g2.setCursor(100, 10);
  u8g2.print (runTime);
  u8g2.sendBuffer();          // transfer internal memory to the display

  if (minutes > 31) {
    digitalWrite(auto_reset, LOW);    // after the minutes clock up to over 31 this resets the whole system
  if (minutes < runTime) {
    digitalWrite (mosfet, HIGH);      // turns on UV LEDs
  else {
    digitalWrite (mosfet, LOW);       // turns off UV LEDs

Sketch uses 20794 bytes (67%) of program storage space. Maximum is 30720 bytes.
Global variables use 1610 bytes (78%) of dynamic memory, leaving 438 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

You haven’t got an error, just a warning.

Ah-ha…so things should be ok then.

Just never seen it previously that I can recall.

bluejets: things should be ok then.

Maybe. Can you F macro those print statements? That would free up some RAM.

I use Atmega1284P chips, which have 16K of SRAM.
One program had a huge array in SRAM, I kept expanding it to use all the SRAM I could. When the program finally crashed from not having enough SRAM, I made the array a little smaller until it didn't crash.
So you have more room than you think would be available.

So you have more room than you think would be available.

The IDE is probably conservative but I suspect that it highly depends on the code.

You are using a considerable amount or ram for the buffer for the OLED display. The U8g2 library can use a full buffer, or a page buffer, the full buffer for a 128x64 display will use enough ram to give you the low memory warning on an atmega328. The page buffer uses considerably less ram, but takes a small bit more code to implement.

Maybe. Can you F macro those print statements? That would free up some RAM.

Tried your suggestion and it changed the global variables use from 78% to 76% but still the warning.

I'll have to look up what is meant by "use full buffer or page buffer".

Quick the code above, I have changed the to lines below. i.e. commented out last line and removed comment from second line.
I believe it has something to do with display buffer but difficult to find information on it.

//U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0);
U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2 (U8G2_R0, A5, A4);
//U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

Since I am not using any graphics, only text, would that be ok..??
Reason is I tried it in the compiler and now no warning message.

Would try it on the hardware but the main unit is gone now and I have to set up a test unit to try the difference.