LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application pauses for up to 4 seconds at random places in processing loop.

We developed a VI that reads data from an image capture card and processes it in a loop. The processing is accomplished at near real-time approaching the 30 fps rate. Periodically, however, the entire system will hang for nearly 4 seconds. This appears to include all Windows activity. The activity monitor shows processor activity peaking (~100&) and attributes the activity to the LabVIEW process (although the monitor ceases to update during the pause). The pause occurs at random points of execution.

Multiple windows (instances of "Image Display") are updated in the loop. When these are bypassed in favor of a floating window, the severity of the problem diminishes significantly, but occurs occasionally (every couple minutes vs every 15 seconds or so).

I was inclined to blame Windows bookkeeping, but as mentioned above, the activity monitor points to LabVIEW. The problem occurs on multiple platforms (laptops) but is most pronounced on the newer dual-core system.
0 Kudos
Message 1 of 55
(4,215 Views)
How much data do you actually have in memory?
0 Kudos
Message 2 of 55
(4,206 Views)

Does sound like a memory issue.

If you watch the memory usage does it keep increasing?

If you look at the LV process, do you see it page faulting?

Post your code so we can be of greater assistance.



Message Edited by Ben on 11-27-2007 11:37 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 55
(4,202 Views)


@altenbach wrote:
How much data do you actually have in memory?





The application processes one image at a time, but in the processing chain there are probably up to ten copies in different formats depending on user selections...say ~720x480x4x10 ~= 14Mbytes max.
0 Kudos
Message 4 of 55
(4,195 Views)

What is the memory footprint of the LabVIEW process in the task manager? Does it increase over time?

Is the code such that memory buffers are re-used or does everything get newly allocated with each new picture?

0 Kudos
Message 5 of 55
(4,191 Views)
Memory usage remains constant throughout process. No growth.
0 Kudos
Message 6 of 55
(4,185 Views)
How much is is compared to your RAM?
0 Kudos
Message 7 of 55
(4,175 Views)

No growth.....

Try watchin the processes tab and sort by top CPU use.

Is LV at the top while you are in the "frozen" state?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 55
(4,174 Views)
The application's process shows as the dominant process. It approaches 100% usage just as the hang occurs. Nothing interacts with the monitor during the hang, including the task manager, but no other task's resources increase around the hang.

I just reassigned the VI's execution priority to "normal" and the problem seems to have subsided. The priority was previously set to "above normal" in order to maintain frame rates while sensor adjustments were made via an independent controller VI.

We have seen similar behavior under Windows when priorities were bumped in .NET applications. Task manager's indication that it was the LabVIEW process that was dominating seemed to point to LabVIEW rather than OS problems.

The immediate problem is resolved, though not completely understood.

Thanks.
0 Kudos
Message 9 of 55
(4,140 Views)

"I just reassigned the VI's execution priority to "normal" and the problem seems to have subsided. The priority was previously set to "above normal" ..."

That will expalin it if LV was doing a lot of number crunching of large data sets etc. Loops with "zero waits" will help.

LV use a concept called "Cooperative multi-Tasking" and harnesses the OS's services to provided that concept. The "Cooperative" part talks to the idea of porcesses making an efforts not to use all of the CPU without allowing other process to access the same. "Zero Waits" (zero constant wired to a wait ms) is one way that we can let LV know that tight number crunching loops can be interupted to handle other processes. The OS is involved because OS's like Windows will blindly assume that a thread that it schedules will willing give up the CPU after a while. If you don't have Zero-waits or you have heavy number crunching, the thread never releases the CPU. When you set the process to be above normal, LV and the OS did exactly what you said to do.

What exactly are you doing when LV uses all of the CPU?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 55
(4,130 Views)