LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

minimize window vs memory usage

Solved!
Go to solution

I have a LabView application (.exe on windows XP)  that acquire data and display a graph of them. If I let run the acquisition, the memory usage (in the Task Manager) starts at ~60MB and is increasing slowly with the number of acquisitions. When I minimize the application window, the memory usage drops to a 3 MB. When I reopen the window, the memory usage will jump to ~6MB and if I restart the acquisition, it increase rapidly to ~20MB and then slowly increase as before.

I have tried to remove the graph but the behavior is the same. Running in the development environment, the minimize window has no effect on the memory usage.

 

Is there someone who knows what LabView and Windows are doing with memory when an application is minimized? It may help to find the source of my memory leak

 

Pierre Cottin

INO

0 Kudos
Message 1 of 5
(3,371 Views)

Hi Pierre,

 

It sounds like the Windows user interface (UI) thread is requiring a lot of the CPU to update the front panel of your VI. When you minimize the screen and the UI doesn't need to update, you see a much lower CPU usage. So, there are a couple of changes you can probably make in your code to make the UI require less CPU to update. What types of front panel objects is your code using? If indicators are updating within a loop, can you change the code to make them update less often?

Product Support Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,341 Views)
Solution
Accepted by topic author PierreCottin

Hello LaRisa,

It's actually a question of memory and not CPU. In the mean time, I have found that this behavior is actually a feature of windows. Take a look at this thread for more details: http://bytes.com/groups/net-c/232400-memory-usage-minimize-windowstate

The problem is that it doesn't help me with my memory leak. Too bad!

 

Pierre Cottin

INO

 

0 Kudos
Message 3 of 5
(3,329 Views)

Hello Pierre,

 

I would try contacting Microsoft support as the issue seems to lie with Windows. Please let us know if you are able to solve the issue. 

Vivek Nath
National Instruments
Applications Engineer

Machine Vision
0 Kudos
Message 4 of 5
(3,294 Views)
As explained in the link attached in my previous post, the reduction of memory usage when minimizing the application window is not an bug, it's a feature of windows shell. The memory leak I experienced is a separate problem I have to figure out in my application.
0 Kudos
Message 5 of 5
(3,286 Views)