Page 1 of 2

UPBv2: Software crashes due to memeory leak

Posted: Sun Feb 21, 2021 9:58 am
by Ruediger
Hello Evans,

I have observed now 2 times, that the software crashes over night silently.
When returning to the PC the next day the application was closed and no logs were written. This happens since last update to 1.4.3.0.

Following entry can be found in Windows application log. It looks like a memory leak:

Application: UPB.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException
at System.Windows.Forms.Application+ThreadContext.OnThreadException(System.Exception)
at System.Windows.Forms.Control.WndProcException(System.Exception)
at System.Windows.Forms.Control+ControlNativeWindow.OnThreadException(System.Exception)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)


CS
RĂ¼diger

Re: UPBv2: Software crashes due to memeory leak

Posted: Sun Feb 21, 2021 8:29 pm
by Evans
Thanks for the update.
We do not have similar reports but I'll check as soon as possible if the application leaks memory.

Re: UPBv2: Software crashes due to memeory leak

Posted: Sun Feb 21, 2021 8:36 pm
by Ruediger
Addendum: I can see in task manager continuously growing memory allocation.
Since it is 32Bit (at least shown) the 4GB limit is reached during that observed time period. Probably that's the reason for the crash.
While typing this message it allocated 30MB more.

Update: Memory usage grows unlimited.
2021-02-22_00h23_00.png
2021-02-22_00h23_00.png (3.22 KiB) Viewed 13100 times
Thank you!

Re: UPBv2: Software crashes due to memeory leak

Posted: Mon Feb 22, 2021 2:20 pm
by Evans
I tried yesterday evening and let it run for the whole night. Consumption was 220Mb when I closed the software (after 9h).

I'll recheck again if any special function causes that.

Re: UPBv2: Software crashes due to memeory leak

Posted: Mon Feb 22, 2021 2:35 pm
by Ruediger
Hi Evans,

I have repeated the test. It is running out of memory every time. Hitting the 4GB margin and then crashing.
2021-02-22_22h40_50.png
2021-02-22_22h40_50.png (3.9 KiB) Viewed 13091 times
Cheers
RĂ¼diger

Re: UPBv2: Software crashes due to memeory leak

Posted: Mon Feb 22, 2021 9:39 pm
by Evans
Hi Ruediger,
It seems that this leak comes from the USB devices listing table.
I'll try to redesign this god damn thing to display better information for all plugged USB devices

Re: UPBv2: Software crashes due to memeory leak

Posted: Mon Feb 22, 2021 9:42 pm
by Ruediger
Thanks a lot!

Re: UPBv2: Software crashes due to memeory leak

Posted: Tue Feb 23, 2021 12:42 pm
by Ruediger
Just received another error pop-up at 1.7GB memory consumption.
When you confirm it with "OK" it keeps opening up again and again. And then UPB crashed with an .net exception but unfortunately when clicking on details the message disappears. It was closed with the application. But Eventlog shows the same error as before. See third screenshot.

2021-02-23_13h39_28.png
2021-02-23_13h39_28.png (3.17 KiB) Viewed 13087 times
2021-02-23_13h39_42.png
2021-02-23_13h39_42.png (1.26 KiB) Viewed 13087 times
2021-02-23_13h39_42.png
2021-02-23_13h39_42.png (1.26 KiB) Viewed 13087 times

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Feb 27, 2021 1:00 pm
by Ruediger
One more error:
2021-02-27_13h59_28.png
2021-02-27_13h59_28.png (1.61 KiB) Viewed 13067 times

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Feb 27, 2021 10:50 pm
by Ruediger
The latest version is absolutely unstable. It crashes frequently. A serious usage is not possible.

Yet another:
2021-02-27_23h48_14.png
2021-02-27_23h48_14.png (21.87 KiB) Viewed 13063 times

Re: UPBv2: Software crashes due to memeory leak

Posted: Mon Mar 01, 2021 4:09 pm
by Evans
Hi Ruediger,
I really cannot explain all these errors in the software. I do not have similar reported issue for the current software.
Still the memory leak is very low compared to what you sent. (screenshots do not lie - maybe something is different in your Windows framework).
I'll do extensive tests about the memory consumption and all of these alerts and we'll be in touch via this thread.
Please expect my findings in 3-4 days from now.

Re: UPBv2: Software crashes due to memeory leak

Posted: Mon Mar 01, 2021 5:43 pm
by Ruediger
Hi Evans,

many thanks for the update. My system is a normal W10 with all updates. Build 20H2 19042.804

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Mar 06, 2021 7:14 pm
by Evans
The latest software version v1.4.4 handles some of these issues (especially the error messages).
Also takes care the memory leak with a workarround. It requires a feature rewrite for better usb devices discovery

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Mar 06, 2021 7:20 pm
by Ruediger
Hi Evans,

I have installed 1.4.4 this afternoon and it is running since. The memory leak is not fixed. The process is growing unlimited.
2021-03-06_20h18_06.png
2021-03-06_20h18_06.png (3.17 KiB) Viewed 12875 times

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Mar 06, 2021 9:03 pm
by Evans
Is the powerbox connected when you observe this memory leak?
Try to just open the software without connecting it to UPB and let me know

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Mar 06, 2021 9:21 pm
by Ruediger
Its fully connected. 4x power, 5xUSB.
It just crashed right in that moment by running out of memory....

And memory got freed:
2021-03-06_22h21_47.png
2021-03-06_22h21_47.png (3.08 KiB) Viewed 12871 times
2021-03-06_22h20_35.png
2021-03-06_22h20_35.png (51.9 KiB) Viewed 12871 times

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Mar 06, 2021 9:35 pm
by Evans
Unfortunatelly I cannot replicate this huge mem leak on my test PC.
Try to uninstall and install this test release -> https://pegasusastro.com/wp-content/upl ... -test1.exe
Let me know if things look better

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Mar 06, 2021 9:42 pm
by Ruediger
Ok. I have installed it. It seems to have the same effect. It grows approx 2 MB per Minute.

Update: It frees memory!!! juhu! It is not growing beyond 20 MB memory footprint.

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Mar 06, 2021 9:48 pm
by Evans
Alright, great! please monitor it for tonight and let me know tomorrow.
(I'll have to rewrite the usb device isting code from scratch)

Re: UPBv2: Software crashes due to memeory leak

Posted: Sat Mar 06, 2021 9:49 pm
by Ruediger
Currently it is stable - not more than 21 MB.