Label.TextColor on Raspberry Pi Leaks Memory Like a Sieve

Still working on my raspberry project, I let it run for about 6 hours and found it had used up just shy of 1.5gb of memory. I have come to the conclusion that setting Label.TextColor leaks about 400-600 bytes of memory every time its called. Has anyone observed this or can see what I am doing wrong?

System: Rasberry Pi 4, Rasbian (does not happen on macOS)

See example project: LeakyLabel

Click the checkbox to set Label.TextColor with the timer, memory should start counting up and not come back down.

Thanks everyone!
Alex

<https://xojo.com/issue/58254>

Looks like this has been verified/fixed, thanks Xojo Team!

Hello, I am still experiencing same problem… Xojo 2019 r3.1 - Raspberry Pi 4, Raspbian
Anyone can confirm has been really fixed?
Thanks everyone!

[quote=478134:@Alessandro Molinari]Hello, I am still experiencing same problem… Xojo 2019 r3.1 - Raspberry Pi 4, Raspbian
Anyone can confirm has been really fixed?
Thanks everyone![/quote]

I have not verified it yet as I just made my own labels using a canvas. I will double check when I get home. May I ask for some sample code for how you are using it and how you know its leaking?

Hi Alex, thanks for you reply! Sure, I did a small project just in order to test it, basically is just a window with a timer that updates the color of ten labels text. If you can give it a try I will be happy to know if this still happens in other systems… I am using Raspberry Pi4, Xojo 2019r1.

Just put a timer and 10 labels on a Windows,in Timer1.Action put:

Label1.TextColor=&c000000
Label2.TextColor=&c000000
Label3.TextColor=&c000000
Label4.TextColor=&c000000
Label5.TextColor=&c000000
Label6.TextColor=&c000000
Label7.TextColor=&c000000
Label8.TextColor=&c000000
Label9.TextColor=&c000000
Label10.TextColor=&c000000

I checked with Raspbian Process Manager and it clearly shows memory constant increase for my test project… :slight_smile:

Thank you!

Check with Runtime.MemoryUsed, how much memory are you leaking for each call to Label.TextColor, I think when I was testing it was leaking about 100 bytes of memory for each call.

about 500 bytes…

Wow! That’s a bit of an issue for me. I change theme based on a dimmer knob, it wouldn’t take long to run out of memory. Please update the feedback case so we can get the Xojo team to take another look at it.

Looking back at my records show that 500 is about what I was leaking too. I have asked for the case to be reopened.

Looks like it has been fixed again, please update us when you can test the next release.

Thanks Alex, I have the same problem… I have a timer that reads an I2C bus at 50ms interval, then some labels need to change color depending upon data received. It takes about 35 seconds to slow down the program and crashing the bus :slight_smile: Hope the have a new release soon… :slight_smile:

Doing a label with a canvas takes a couple of minutes at most.

My project has more than 200 labels in 10 windows, not so easy to replace them all…

I have the same amount of labels, I just made a custom label using a canvas that has the same methods as a normal label, then just search and replaced them all.