01-29-2007 12:17 PM
01-29-2007 01:25 PM
I didn't run the code, and I don't think there should be a difference between 7 and 8 (meaning this might be a bug), but I can give you some advice.
First, the Request Deallocation won't help. ActiveX reference refer to external resources, so LV will not dispose of them automatically until the VI goes idle.
Second, if you look inside the "open wiff" VI, you will see that you do have a memory leak. You're wiring a reference in, getting another reference inside and wiring that one out, without closing the original reference. I don't know if this is enough for your leak, but you might have this elsewhere as well.
Third, you might want to see if you can monitor the memory usage of specific VIs using the profiling tools. I don't know if this applies to ActiveX references as well, but it might help.
Fourth, if you have an error when dequeuing, your program will get stuck. This has nothing to do with the memory leak and will probably not happen, but I just thought I should mention it.
BTW, I like the error handling VIs. I haven't had the time to run them, but if I understand correctly what they do, it sounds interesting.
01-29-2007 01:58 PM
On the first issue, I believe this made sense as it made no difference, but was a recomendation from NI so I tried it.
On the second issue, I just put in a close ref on the input to the Variant to Data function. This ensures that the reference being passed iin will be empty. The Variant to Data function only creates a new instance of the type of reference being passed in. At this point in the code, the reference has already been closed from a previous VI and I am only using it as a type, as I know it doesn't replace the reference. This was a good check though and looked at all my other variant to data functions just in case but still the same results in LV82.
Third thing is that I tried the profiling tools but it didn't offer a way to track active x data or the memory leak at all. They offered me how much average memory and max they used.
thanks on the fourth. I put in some extra error dialogs now there in case something does happen.