04-09-2015 03:51 AM
Hello All,
I am developing a medium sized application consisting of 2 windows, one for graphing and the other for file replay. 1 file of typically 35MB can load ok and a second also loads ok, but when a third is loaded the machine will often lock up, get laggy. I noticed laptops running the code will lockup with 2 files loaded.
I used Task Manager to look at what going on and noticed the memory is almost full when the code runs. The CPU usage is acceptable, typically 60% when loading and 10% when the code is idle.
PC is intel i5-4440 3.1GHz
OS windows 8.1 64 bit
memory 8GB ram
Next is a list of how Task Manager shows the memory filling up:
available 7.9 GB
Only Windows running 1.8 GB
Labview IDE loaded 2.0 GB
Labview Project loaded 2.1 GB
Software loaded 2.2 GB
Software started (idle) 3.2 GB
Software with 2 x 35MB files loaded 6.6 GB
I appears I have used up all of the memory, I notice a big memory hit when I start the code, and then loading files causes memory usage to escalate away. Ive already looked at trying to make my code more memory efficient but timing showed its already ok. I'd appreciate some advice, first thoughts are... will a recompile flush saved data? I pinpointed the 5 vis that cause the 3.2 to 6.6 GB jump just after loading the files (would dynamic loading help?). I noticed that once a vi executes its memory usage sits theres consuming space which isnt recovered until labview is closed.
Should I try using 'Dynamically Loading vis' as I understand dynamic execution loads the vi + memory space, does the work then drops itself and memory used from available memory freeing it up for other stuff. If dynamic loading is the solution are there any good 'how to dynamic load vis' on the net, please?
I am not sure if ive understood this problem correctly if not please correct me.
Advice appreciated
Regards
Chris
04-09-2015 03:59 AM
You seem to have some pretty inefficient code in terms of processing your 35MB files. It's not really possible in LabVIEW to avoid data copies when operating on data but a 35MB file causing an increase of 1.6GB of memory consumption is almost certainly optimizable even if you convert those 35MB data from an int16 representation to a double precsion representation on loading.
Without seeing the processing that is done with these 35MB files it is however impossible to indicate any feasable amount of memory you would at least need.
04-09-2015 07:52 PM
04-10-2015 07:15 AM
Hi Chris,
As has been mentioned, it is quite difficult to figure out what is taking up your memory without seeing your code so if you post that up that would be interesting to see.
For an example of programmatically loading VI's, please view the following link.
http://digital.ni.com/public.nsf/allkb/9282BA6C907DF5B2862572480069E570
Thank you.
Kind regards,
Nigel Chan