NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Copying FileGlobals containers

Hello,

 

I need to delay my custom reporting and move it to a different sequence. In order to preserve Locals.ResultList I copy it to a FileGlobals variable, like this:

Evaluate("FileGlobals.ResultListN"+Str(RunState.TestSockets.MyIndex+1))=Locals.ResultList

 

My program that contains vision and other components crashes after 30-50 parts with "out of memory" error and I then I get LabView window informing me that a number of objects were not released. I see a lot of ResultList variables that I created. My question is: is it possible that the above copying is causing a memory leak? Is there a way to release these objects explicitly? Or maybe another way to accomplish the same task?

 

Thanks

CT

Message 1 of 7
(4,056 Views)

Other options - You can use the database options to store data for further processing.

 

 

0 Kudos
Message 2 of 7
(4,049 Views)

It does indeed sound like you have an issue related to not releasing references properly. That or the calculation that you're performing has a contiguous memory size that's too large to work with. Can you post a picture of the LV message you're seeing? Also, a further explanation of the vision calculations you're performing (maybe even post the code) would be helpful.

Tim A.
0 Kudos
Message 3 of 7
(4,017 Views)

Hi,

 

Here's a picture of an error I am getting. THere's close to 100 objects that report an error

Thanks

CT

0 Kudos
Message 4 of 7
(4,001 Views)

Hey CT,

 

It definitely looks like there is some kind of leak or memory build up that's producing this error. I'm wondering if the reason why these were not released is that the sequence containing these variables had just not finished so they were all still loaded in memory. Would it be possible for you to save the ResultList information to a location outside of the local memory that the program uses? Like a database or a file location.

 

I need to investigate further if this specific function is producing a memory leak though. I'm not familiar with a technique to explicitly destroy references so I need to investigate this as well.

 

Also, In your first post, you mentioned that you had to delay the custom reporting. Could you expand on why you need to do this?

Tim A.
0 Kudos
Message 5 of 7
(3,976 Views)

Hi Tim,

 

Yes, I am using multiple sequences within my sequence file. Most of the them are control sequences. My custom reporting VI iterates through Locals.ResultList container and extracts Lo, Hi limits, values etc. That all goes to a custom text file defined by my customer. What I found that the process of going through all elements was taking a substantial amount of time (1-2 seconds per socket). What I did then is I moved the call to another sequence. But at this point my locals.ResultList from my functional sequence does not exists anymore. At least if it does I do not know where and how to get to it. To solve this problem I copy Locals.ResultList to FileGlobals.ResultList that. This way it is available when I need it. This is done every 15 seconds and I suspect that TestStand does not destroy these objects immediately and when it crashes I see them reported as object leaks.

Thanks

CT

0 Kudos
Message 6 of 7
(3,960 Views)

Thanks for the clarification CT.

 

I don't think that the error you're receiving is being caused by a memory leak necessarily but by just handling a very large result list. I've got a couple more clarifying questions,

 

How many test sockets are you working with?

How often and when are you populating the FileGlobal variable? As part of the process model or just your sequence?

(I'm trying to get an idea of just how large your array of containers for reporting is by the time you try to access it with the custom reporting VI)

 

We may be running into a situation where the amount of results we're looking to process is simply just too large and we don't have enough memory to handle the contiguous array of results. Have you worked with or considered any kind of on-the-fly reporting? We can likely modify the built in on-the-fly processing to include your custom VI reporting. Otherwise, you may need to develop your own sort of similar method in order to reduce the memory size.

Tim A.
0 Kudos
Message 7 of 7
(3,944 Views)