LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does minimizing a window reduce RAM usage in an exe?

Solved!
Go to solution

I've noticed this ever since LV8.5 (I am currently using LV2010 with IMAQ 4.5), that whenever I minimize my exe, the RAM usage in Windows Task Manager drops dramatically.  My exe loads and unloads lots of images and the RAM usage goes up to around 500MB for the exe.  As soon as I minimize the exe window it drops to about 13MB.

 

Can anyone explain why this is happening?

 

Thanks,

Bruce

0 Kudos
Message 1 of 6
(3,245 Views)

 


@BruceMoyer wrote:

I've noticed this ever since LV8.5 (I am currently using LV2010 with IMAQ 4.5), that whenever I minimize my exe, the RAM usage in Windows Task Manager drops dramatically.  My exe loads and unloads lots of images and the RAM usage goes up to around 500MB for the exe.  As soon as I minimize the exe window it drops to about 13MB.

 

Can anyone explain why this is happening?

 

Thanks,

Bruce


 

I think you answered it for yourself Smiley Wink

The operating system will take care of most of your resource allocations (except of course memory management explicitly done in LabVIEW or otherwise).

When you minimize your VI, there is nothing to display, so your OS will not load it until the window is back up again.

Cory K
0 Kudos
Message 2 of 6
(3,234 Views)
Solution
Accepted by topic author BruceMoyer

It is very likely that when you minimize your application, Windows decides to page most of that memory to disk, because the application is probably not being used actively. Therefore Windows decides to reclaim the memory for other active applications.

 

You can test this by showing the Virtual Memory column in Windows Task Manager. There you see all the paged memory your application is using. Your app is still using the same amount of memory, but Windows can store that in Virtual Memory on your hard disk until it's needed again.

Jarrod S.
National Instruments
Message 3 of 6
(3,205 Views)

Try minimizing Internet Explorer or similar with a couple of tabs similar and the same thing will happen.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(3,180 Views)

Thanks, I never thought to look at the Virtual RAM usage in Windows Task Manager.  Actually I didn't know that it even existed on a process level.  I guess what surprised me is how quickly the RAM dropped, I would have thought that it would take a few seconds to cache to disk, but I guess that is done while the data is being loaded into RAM.

 

I was wondering if there was any benefit to programmatically minimizing and then reopening the window to reduce RAM usage but I guess this wouldn't be of any benefit.

 

Thanks,

Bruce 

0 Kudos
Message 5 of 6
(3,157 Views)

@BruceMoyer wrote:

Thanks, I never thought to look at the Virtual RAM usage in Windows Task Manager.  Actually I didn't know that it even existed on a process level.  I guess what surprised me is how quickly the RAM dropped, I would have thought that it would take a few seconds to cache to disk, but I guess that is done while the data is being loaded into RAM.

 

I was wondering if there was any benefit to programmatically minimizing and then reopening the window to reduce RAM usage but I guess this wouldn't be of any benefit.

 

Thanks,

Bruce 


I did see a benfit when workin large data sets and 3d graphs. A graph that would take 45 minutes to refresh wiht the window open could do the same in about a minute if the screen was minimized.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(3,109 Views)