Differents compiling results with the same code

Hi,

Ive been programming a sketch to control a watermark sensor but Ive realized that the same code gets differents compiling results, regarding RAM consumption, depending on the operating system which is built. the really problem is that I need to develope the code at the head office then send the sketch to another place where it is going to be uploaded to the board and because my computer has one operating systems and the PC thats going to upload the sketch has another the last one gets another compiling results in the way that I get an advice that shows I could have stability problem in the board because of RAM consumption. I would like to get the same compiling results both of PCs so that the second one PC doesnt exceed RAM consumption and gets the same results that my PC which as a matter of fact gets very good quantity of RAM consumption. In the attachments I left a couple a images about de problem

the results obtained are as follows:

win 10 pro 70% consumption of dynamic memory

win 10 enterprise 54% consumption of dynamic memory

Ubuntu 16.04 distro Gnome 70% consumption of dynamic memory

and the code is as follows:

// Select your modem:
#define TINY_GSM_MODEM_SIM800

#include <TinyGsmClient.h>
#include <PubSubClient.h>
#include <LiquidCrystal_I2C.h> //Libreria LCD
#include "DHT.h"
#include <EEPROM.h>

 /******************************************************/
/* Variables de  ***************************************/
long analogPin0 = 0, analogPin1 = 1, val = 0, valtemp=0;
float  rsensor = 0, vr1, vsensor, R1;
int steps=0; 
long intervalo=1;
unsigned long current_millis;
#define minuto 5000
#define myled 5
#define myled2 6
#define resistencia 3400


#define DHTTYPE DHT11
#define DHTPIN 4
DHT dht(DHTPIN, DHTTYPE);



// Your GPRS credentials
// Leave empty, if missing user or pass
const char apn[]  = "em";
const char user[] = "";
const char pass[] = "";

// Use Hardware Serial on Mega, Leonardo, Micro
#define SerialAT Serial
TinyGsm modem(SerialAT);
TinyGsmClient client2(modem);
PubSubClient client(client2);

//Datos Mosquitto
const char* mqttServer = "tecnoandina-server.ddns.net";
//const char* mqttServer = "iot.eclipse.org";
const int mqttPort = 1883;
const char* mqttUser = "tecnoandina";
const char* mqttPassWd = "kennedy5600";
#define modelNumber  "TecAnd0000"
#define serialNumber "yulman"
const char* mqttID = serialNumber;

LiquidCrystal_I2C lcd(0x3f, 20, 4);

void setup() {
current_millis=5000;

EEPROM.write(1,1);
   dht.begin();
  pinMode(myled, OUTPUT);
  pinMode(myled2, OUTPUT);
  Serial.begin(115200);
  delay(10);

  // LCD
  lcd.init();
// // lcd.backlight();
 lcd.clear();



  // Set GSM module baud rate
  SerialAT.begin(115200);
  delay(3000);

  // Restart takes quite some time
  // To skip it, call init() instead of restart()
  Serial.println(F("Initializing modem..."));
   lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(F("Initializing modem"));
  modem.restart();


  //modem.getModemInfo();
  Serial.print(F("Modem: "));
 // Serial.println(modemInfo);

  // Unlock your SIM card with a PIN
  //modem.simUnlock("1234");


  lcd.setCursor(0, 1);
  lcd.print(F("Waiting Network"));
  Serial.print(F("Waiting for network..."));
  if (!modem.waitForNetwork()) {
    Serial.println(F(" fail"));
    while (true);
  }

   lcd.print(F(" OK"));
  Serial.println(F(" conexion a red OK"));

  Serial.print(F("Connecting to: "));
  delay(2000);
  Serial.println(apn);
   lcd.setCursor(0, 2);
  lcd.print(F("Connecting APN"));
  if (!modem.gprsConnect(apn, user, pass)) {
    Serial.println(F(" fail"));
     lcd.setCursor(0, 2);
    lcd.print(F("                    "));
    lcd.setCursor(0, 2);
    lcd.print(F("Network Fail"));
    while (true);
  }

 lcd.setCursor(0, 2);
    lcd.print(F("                    "));
    lcd.setCursor(0, 2);
lcd.print(F("Connecting APN OK"));
  Serial.println("conexion al APN OK");

mqtt_connect();
 

}






void loop() {



//************************************************TELEGRAPH**************************************************************
String telegraph="soilMoisture,modelNumber=pp0011,serialNumber=9YLQMR,verSoft=0.1 ";
//************************************************TELEGRAPH**************************************************************



if (!client.connected())
{
reconnect();
}
client.loop();



float h = dht.readHumidity();
float t = dht.readTemperature();



telegraph=telegraph+"soilMoist="+(String)humedad()+",dhtHum="+(String)h+",dhtTemp="+(String)t+",bat="+(String)medicion();
client.publish("pp0011/9YLQMR/output/status",telegraph.c_str());


delay(300000);
}



//********************************************CALLBACK********************************************************************

void callback(char* topic, byte* payload, unsigned int length) {

  const char len = length;
  char mensaje[len];
  String TOPic = topic;
 
if(TOPic=="pp0011/9YLQMR/input/intervalo")
 {

 
for (int i = 0; i < length;  i++)
 {
 mensaje[i]=(char)payload[i];
 }
String payld=mensaje;
EEPROM.write(1,atoi(payld.c_str()));

 }


if(TOPic=="pp0011/9YLQMR/input/LCD")
{

for (int i = 0; i < length;  i++)
 {
 mensaje[i]=(char)payload[i];
 }

 if(!(strncmp(mensaje,"on",2)))
  {
   
   lcd.backlight();

  }

  if(!(strncmp(mensaje,"off",3)))
  { 
  

  lcd.noBacklight();
  
  }

}   



}

void mqtt_connect()
{
  //********************LOOP MQTT******************************
//***********************************************************
lcd.setCursor(0, 3);
    lcd.print(F("                    "));
    lcd.setCursor(0, 3);
    lcd.print(F("Connecting MQTT"));
    
  client.setServer(mqttServer, mqttPort);
  client.setCallback(callback);
  while (!client.connected()) {
    Serial.print(F("Connecting to MQTT "));
    Serial.println(mqttServer);

   if (client.connect(mqttID,mqttUser,mqttPassWd,"humedad/estudio",1,1,"OFFLINE")) { 
   //client.publish("humedad/estudio","ONLINE",true);
   Serial.println(F("Yulman Connected to MQTT Broker"));
   Serial.println(F("----------------------------------------"));
      lcd.setCursor(0, 3);
      lcd.print(F("                    "));
      lcd.setCursor(0, 3);
      lcd.print(F("MQTT OK"));
    }//End If
    else {
      //Serial.print("failed with state: ");
      //Serial.println(client.state());
      delay(2000);
    }//End Else

client.subscribe("pp0011/9YLQMR/input/intervalo");

}//END While
}

void reconnect() {
  // Loop until we're reconnected
  while (!client.connected()) {
   
   if (client.connect(mqttID,mqttUser,mqttPassWd,"humedad/estudio",1,1,"OFFLINE")) { 
   //client.publish("status/gsm","ONLINE",true);
   // client.publish("humedad/estudio","ONLINE",true);
client.subscribe("pp0011/9YLQMR/input/intervalo");

    } 
      delay(500);
    }
  }



 int humedad()
 {

   #define retardo 5
   String sensor="";
 
for(int i=0;i<50;i++)
{

 digitalWrite(myled, LOW);   
 digitalWrite(myled2, HIGH);
 val =val+analogRead(analogPin1);
 delay(retardo);      
  
  
 digitalWrite(myled2, LOW);
 digitalWrite(myled, HIGH);    
 val = val+analogRead(analogPin0);
 digitalWrite(myled, LOW);   
 delay(retardo);    

}

Serial.println();

valtemp=val/100;
vr1=((valtemp*4.3)/((4.3*1024)/5));
vsensor=4.3-vr1;
rsensor=(vsensor)/(vr1/3300);
R1=vr1/(vsensor/3300);


sensor=String(rsensor);

val=0;

return atoi(sensor.c_str());
 }





float medicion()
{
  
  
  steps++;
  int f=3;
  char _voltaje[10];
  float a = analogRead(3);
  float b = (a*12)/800; 



  String k= (String)b;

 

if(steps>120)
{
     steps=0;

}
return b;
}

That seems more likely to be caused by having different versions of the libraries you use installed on the different systems...

We have the same libraries every PC we use to compile the sketch