07-20-2009 08:20 AM
Hello
I am stucked with a very annoying .NET memory problem. When I build vi's with .NET event callbacks and run them for a long time the application fills up the system memory continiously. My last test started with a application builder *.exe with one callback. I started on friday with a memory consumption of about 40MB and ended on monday morning with a consumption of 850MB. Also the cpu load increased in thes time from about 0 to 25%.
The on change event was triggerd about every 50ms and the callback vi was very simple, nearly only increasing a global numeric. Ate the end the value was about 900000 so the callback was triggerd 900000 times.
Here I have now attached vi with the same problem. It is a slight modification of the labview's build in .NET example with an increased event timing of every 5ms.
Hope someone can help me to find out from where these things are coming
I always try to close every refernce in the callback so I hope this is not the fundamental problem.
Thanks in advance
Best regards
Gernot
07-20-2009 12:14 PM
07-21-2009 01:04 AM
Thank you for this idea
I have alredy veryfied this, but used the LV build in example to show the problem.
I also used the mscorlib. Timer to verify. I set the timer interval to 5ms and have seen the identical problem.
So it seems not to be a .NET assembly problem or framework problem but a LV problem when using .NET.
I also verified by using Visual Basic .NET where it is no problem.
Cheers
Gernot
07-21-2009 03:45 AM
Hi smercurio, Hi Gernot,
I already handled this issue with Gernot in a support request. I was able to reproduce the issue also with the mscorlib. Timer and I´ll ask for explanation to our R&Dcause it seems to be a known issue.
Best regards.
Andrea Perin
Application Engineer
NI Germany
07-21-2009 04:18 AM
Sorry for the duplicate way to find the solution.
Thank all for the help
Gernot
06-14-2016 02:04 PM
Resurrecting an old thread, was this ever resolved?
06-14-2016 08:17 PM
06-15-2016 12:48 AM - edited 06-15-2016 01:01 AM
Yes certainly long enough that this should have been fixed by now. I asked as perhaps I am doing something silly.
I have a problem which I have exhaustively (as in physically exhausting) proven to be caused by a .NET callback hogging memory.
I have implemented a simple timer/scheduler mechanism that fires off a User Event, and at its core is a .NET time object which I have wrapped in a LabVIEW class to make nice and east to use. The code works great (see footnote), but over time memory just slowly runs away. Disabling the timers completely fixes the problem. I have created a messaging framework, so I thought I had a memory leak somewhere in that.
Attached is a bif of the Timer class code, am I doing something stupid here?
*except for the fact that the callback was never released which caused my class to remain locked. Silver lining here is that in my attempt to understand the problem I stumbled upon this bug note, which does indeed fix that particular problem.
07-06-2016 05:42 AM
I am facing the problem of memory leak when I use event callback vi in LabVIEW2014 SP1. I am fetching images from .Net dll and it is consuming memory and application crash after certain amount of time. If i stop the vi, the callback vi is in the running state and doesn't allow me to edit. How to resolve this problem?
09-27-2020 12:34 AM
Hi Neil,
Were you able to resolve this issue? If yes, can you please advise me on the solution?
Thanks,
Pranay