11-13-2016 05:10 AM
Hello everyone,
I am trying to detect all the COMmunication ports (COM1,2,3...) by using WMI Classes directly from labview.
This VI is called repeadly from the main application, and checking task manager I detected a big memory leakage, let's say about 1Mb as avarage at every call.
The memory is freed when I close the application, but this is a problem, because the subvi have to be called frequently (let's say 2 times at second) to detect new USB/RS232 interface attached on the fly.
I'm not expert in .NET, and I used an idea of Lycangeek
http://forums.ni.com/t5/LabVIEW/How-to-access-WMI-Classes-via-NET-in-LabVIEW/td-p/253845?lang=en
but even tying to close references and dispose object, there is still an error.
Does someone can help me, please?
Marco.
11-14-2016 03:13 AM
A quick test on the final post VI in the other thread shows that the Constructor node allocates a lot of memory, move it outside any loop and thing will calm down significantly.
/Y