08-12-2008 02:56 AM
08-12-2008 04:50 PM - edited 08-12-2008 04:59 PM
08-13-2008 05:00 PM
Hi Cosmin,
If you can't post the whole code, it is possible for you to replicate the problem and put up a smaller piece of code to test. It is difficult to come to any type of conclusion without having something to work with.
08-13-2008 06:08 PM
Regarding the DS memory leak, would the following VI leak in LV8.5? We call this VI severla times in our code (but not in a loop). Does it matter how many times we call it? Does the leak only happen if we call it several times quickly? Do I need to cache the DS ref so I only call open once?
-John
08-14-2008 10:17 AM
Hi John,
Are you seeing a memory leak? The only known issue with memory leaks and data sockets is when you use data socket active X VIs. The issue and the workaround is posted here.
08-14-2008 12:19 PM
Yes, I am seeing a slow memory leak, but I do not know if it is coming from the DS open-close. I read the workaround. What do you mean by 'ActiveX' VIs? Are the standard DS VIs using ActiveX or are there other VIs for DS that use ActiveX?
The workaround states to open, do all your writes and then close. What if this operation is used many times in many places in an app that is supposed to run for many weeks? Am I supposed to cache the open ref and then pass it around? Is the leak coming from the open command or is the close simply not cleaning up properly? Does it matter what kind of write or read operation I do (I only use lookout calls to a remote cFP unit). What if this VI is reentrant and can be called by multiple threads simutaneously?
Pleae provide a lot more detail on this issue and look at my VI.
thanks,
-John
08-15-2008 04:16 PM
Hi John,
I took a look at your VI and it does use DataSocket Active X. An example of a datasocket ActiveX vi is Browse to OPC item.vi in the shipping examples.
I tried to run your VI but it looks like you are using an internal IP address in your VI (which of course I wouldn't have access to). After how long to do you see your memory leak? Have you tried to use the VI profile window to track memory use for your VI. This knowledgebase has instructions on it.
Thanks,
08-15-2008 05:00 PM
My VI just writes to a DIO output on a DIO card in a cFP unit that has the ethernet interface (no controller). Yes, this is a piece of HW in out lab. You could easily reproduce this by writting to a DIO card in your own cFP unit at NI.
I do see a slow leak (over many days) in my application. I call this VI about 200 times a day.
So, what you are telling me is the bug with DS will cause this VI to leak. Do you have any suggestions for how to work around this? The problem I have is many asyncronos threads are calling this VI so it has to be set to reentrant and therefore storing one global DS session and reusing it is not practical.
08-18-2008 01:21 PM
Sorry jlokanis. I just re-read my last post and realized that I forgot that all important NOT in this sentence. " I took a look at your VI and it does use DataSocket Active X". What I meant to say was the your VI does NOT use ActiveX datasocket VIs.So this bug is NOT applicable to you.
I am curious to know how to diagnose that the memory leak is due to this particular VI.
Thanks!