12-10-2022 01:03 AM
So, what does this .NET code do? could you share some prototypes of these methods you invoke to understand the data that is marshaled between LV and .NET?
Would you be able to disable all .NET codes in LV and see if the issue comes up?
12-12-2022 03:32 AM
@EthanHenry wrote:
I could try but it’s only in a couple of spots. Also I feel it’s important to mention that the memory leak doesn’t SEEM to occur in dev mode, only in exe mode.
If you compile the exe with debugging enabled, it should run mostly the same as the development system.
Except of course if you used conditional disabled structures, or in other ways check if you're in run time or not.
Paths and dynamic VIs might behave differently too (FPs get removed). This could make exes behave differently, although it usually causes behavioral bugs, not memory leaks.
Seems to me you're not even sure if there is a problem? LabVIEW, .NET and Windows all have mechanisms to handle memory efficiently. Large chunks of memory might not be released until they're idle some some time, or even until other processes claim memory. Task manager can be used to spot memory problems, but only if it keeps growing and growing over time. If not, there might not be a problem at all.
It will be hard to advice without seeing code...
12-12-2022 11:01 AM
wiebe@CARYA wrote:
@EthanHenry wrote:
I could try but it’s only in a couple of spots. Also I feel it’s important to mention that the memory leak doesn’t SEEM to occur in dev mode, only in exe mode.
Seems to me you're not even sure if there is a problem?
It will be hard to advice without seeing code...
The OP says the exe exits with an error... seems to me like there is a problem. Maybe not a memory leak problem. I have never had an exe that ends with an error.... of course, I have not actually written a whole lot of exe.
12-12-2022 12:12 PM
@Frozen wrote:
wiebe@CARYA wrote:
@EthanHenry wrote:
I could try but it’s only in a couple of spots. Also I feel it’s important to mention that the memory leak doesn’t SEEM to occur in dev mode, only in exe mode.
Seems to me you're not even sure if there is a problem?
It will be hard to advice without seeing code...
The OP says the exe exits with an error... seems to me like there is a problem. Maybe not a memory leak problem. I have never had an exe that ends with an error.... of course, I have not actually written a whole lot of exe.
Yes, that error is a problem.
It could be related to the memory or the same problem or totally unrelated. If the memory is indeed a problem.
12-12-2022 12:24 PM
You’re both correct in that I’m not sure if there is a memory error, however there is an error somewhere. We’ve had people who’ve run it for months have it suddenly crash the computer, which is the main reason we suspect memory leak. As for the particular error I’m not sure, so I’m just trying to give as much info, as it’s very likely I’ve missed something. Sadly I can’t really post the code (much too large). Some more information is that I usually run the exe as an administrator, as otherwise, when I shut it down, I get a pop up with the 0xc000005 error, while when I run it in admin mode it only gets reported to windows logs.
I’ll try and look into the .net code, see if anything fishy is happening there, and I’ll get back to you all. Thanks again for taking time to help!
12-12-2022 12:43 PM
@EthanHenry wrote:
Some more information is that I usually run the exe as an administrator, as otherwise, when I shut it down, I get a pop up with the 0xc000005 error, while when I run it in admin mode it only gets reported to windows logs.
That is some interesting information.... what exactly is getting "reported to windows logs"? (not that I would know what it means, but someone else might)
12-12-2022 12:48 PM
I posted it a little bit back. It reports 3 events, all of which seem to be connected.
12-12-2022 03:45 PM
Alright so I did some digging including finding the lvlog for after I shutdown and get the c0000005 error. I notice that all of them mention Get LV Class Default Value.vi. Can anyone else tell if there's any important data in here?
12-12-2022 04:42 PM
I HAVE CONFIRMATION THAT IT WAS MEMORY RELATED! We were able to retrieve the logs from the computer that had crashed and, around the time it crashed, there is a warning that "Windows successfully diagnosed a low virtual memory condition." It then follows saying that the LabVIEW exe was amongst the highest memory consumers with 1027399680 bytes. On the flip side of that, since the Resource Exhaustion detector ran multiple times, I can do some quick math and see that the memory usage grew at about .06 MB per 1.5 hours. I think I'm just going to need to stick this one out and see where it goes.
12-13-2022 02:59 AM
Still the crash could be caused by for instance a CFLN (running out of memory), while the leak is caused by a .NET node (causing low memory).
I don't recall a 0xC0000005 that wasn't caused by a CLFN, often a CLFN in DCS or IMAQ. Never .NET, although .NET code can potentially do things a CFLN node does.
0.6 MB per 1.5 hours isn't much, and a single .net reference in a slow loop could cause that.