Operator Memory Bug

This file I only add an “UDP In” operator,Keep receiving data from other programs.


The node will save the data in memory.
As time goes by, TD takes up more and more of the memory.

11.png

22.png

33.png

44.png

Sometimes,I find my 16G memory is all used up, the computer can not be normal operation.

How to clear this memory?

Can you tell us what program is sending these messages so we can try to reproduce the issue? Have you changed any of the parameters on the node or are they the default (so we can try to reproduce the issue here).

Thanks for the report

If Arduino keep sending data to TD, after a period of time, my computer will blue screen.
Now I change the Arduino to send UDP data to TD.For 20 hours of observation, my PC is still running normally, but I found that the memory of the TD will gradually increase the occupancy.

The Arduino Code:

/*
UDPSendReceiveString:
This sketch receives UDP message strings, prints them to the serial port
and sends an “acknowledge” string back to the sender

A Processing sketch is included at the end of file that can be used to send
and received messages for testing with a computer.

created 21 Aug 2010
by Michael Margolis

This code is in the public domain.
*/

#include <SPI.h> // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <EthernetUdp.h> // UDP library from: bjoern@cs.stanford.edu 12/30/2008

#define ENCODER_A_PIN 2
#define ENCODER_B_PIN 3
#define SWITCH_PIN 4
long p1;
long p2;

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 232);
IPAddress TargetIP(192, 168, 1, 121);

unsigned int localPort = 8999; // local port to listen on

// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
char udpstr_head[] = "setInput "angle" “; // a string to send back
char udpstr_tail[] = " 0\r\n”; // a string to send back

char pos1[64];

// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;

void setup() {
pinMode(ENCODER_A_PIN, INPUT);
pinMode(ENCODER_B_PIN, INPUT);
pinMode(SWITCH_PIN, INPUT);
pinMode(ENCODER_A_PIN, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(ENCODER_A_PIN), read_quadrature, FALLING);

// start the Ethernet and UDP:
Ethernet.begin(mac, ip);
Udp.begin(localPort);

Serial.begin(115200);
}

void loop() {

//if (p2 != p1){
Udp.beginPacket(TargetIP, 3040);
ltoa(p1,pos1,10);
//Udp.write(udpstr_head);
Udp.write(“\r”);
Udp.write(pos1);
Udp.write(“\n”);
//Udp.write(udpstr_tail);
Udp.endPacket();

  p1=p1+10;
  delay(8);
  //p2 = p1;
  //t2 = t1;

//}

}

void read_quadrature() {

if (digitalRead(ENCODER_B_PIN) == LOW) {
p1++;
}

else {
p1–;
}

}

char* itostr(char *str, int i)
{
sprintf(str, “%d”, i);
return str;
}