LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Are my CPU & Mem Usage are perfect??

Hello All,
 
I am trying to prove myself whether my VIs are "not overriding the CPU occupancy and memory usage" or not? What is the correct way of finding it through, is there any thumb rule to find that in Labview? what xx,xxxkbs are supposed to be under mem usage when we open the "taskmanager"? Is there anything that can give a sign of good or not good usage and situation?
 
My scenario briefly: I have attached my PC information below. I have been running 5VIs which are doing DAQ opeartion and putting the data into access database. These VIs are expected to run 365days&24/7 to aquire the data(data is from loadcells,temp sensors,rpm,current etc).
 
Using Labview 8.5 version.
 
Thanking you.
0 Kudos
Message 1 of 8
(2,834 Views)
There is no way to tell how much memory an application should take. But what
you can tell, if whether it is growing or not.

To test this, simply start the app., write down the memory use values, and
do the same after a few days. That is the most reliable way to test it.

You can make benchmark programs specifically designed to stress some
routines. For instance, take a DAQ routine that is called every minute, and
make a test program that calls it every second. If there is a leak, it will
show 60 times faster!

Seach the forum for "memory leak" to find more on the subject.

Regards,

Wiebe.


0 Kudos
Message 2 of 8
(2,807 Views)
Further to what Wiebe mentionned, you may want to make sure that you keep your CPU usage relatively low (runs cooler) and implement code in such a way not to abuse memory usage.
 
One way to accomplish lower CPU usage is to minimize loops and unnecessary iteration of loops.  I typically use State Machines, Event Structures, or Producer-Consumer loops for that (or combinations). Queues & notifiers are also useful. 
 
A suggestion to avoid memory abuse it to wire directly as much as possible.  Avoid Locals & Globals.  Make sure all references are opened / closed appropriately.
Minimize screen refresh if you display things like graphs, or update indicator values.  Do not use unnecessary indicators.
 
The above should be a good starting point.
 
RayR
0 Kudos
Message 3 of 8
(2,800 Views)
Parny,

What I am about to say is of course not applicable to every circumstance, but unless you are doing lots of serious data manipulation, on a modern computer you really shouldnt be using more than 10% of the CPU, as measured by the windows task manager.

A neat tool, developed by Microsoft, is Process Explorer. Think of it as Task Manager on steroids. It provides lots of nice information about running processes including things like maximum memory used etc. Its much better than task manager, and in fact from the screen shots of Windows 7 that I have seen it is actually used as the default task manager in the new operating system.

Regarding memory usage, LabVIEW has gotten far worse over the years, a really simple compiled exe can take up to 50 or 60 MB of memory. Again this is probably moot as we have reached the stage where 2 GB of RAM is pretty much standard these days (and dirt cheap). As was mentioned by other posters, what you want to look for is the memory increasing over time (a sure sign of a poorly coded application).

nrp
0 Kudos
Message 4 of 8
(2,773 Views)

Just to be nitpicky, Process Explorer was developed by Sysinternals and was later bought by Microsoft (not unlike other Microsoft products like DOS, IE and SQL Server, which weren't started from scratch). I think they actually bought the entire company.

P.S. This isn't MS bashing. Other companies (like Apple) do it too and it's not illegitimate.


___________________
Try to take over the world!
0 Kudos
Message 5 of 8
(2,754 Views)
Thanks for all the suggestions.
 
Actually, I had few situations before where a single vi hung up, got terminated with error-200279(may find from my old posts) and forcing all other VIs to shut as well.
 
Now, I have removed some of the less preferable waveform charts and numeric indicators that signed some reductions in memory usage(in taskmanager). Other thing that I have also observed is the 'memory usage'(in taskmanager) toggles down heavily whenever I minimise(I stick to this always) and goes up while restoring the vi frontpannel screen.
 
Re:Wiebe.
I think am already too late in doing this, but may give a fresh start. But was able to smell from its behaviour.
 
RayR wrote:
>A suggestion to avoid memory abuse it to wire directly as much as possible.  Avoid Locals & Globals.  Make sure all references are opened / closed appropriately.
>Minimize screen refresh if you display things like graphs, or update indicator values.  Do not use unnecessary indicators.
 
I too have some globals and few many locals in every vi, database references are not closed very oftenly, and also few array duplications(inevitable).Smiley Tongue
 
nrp wrote:
>Regarding memory usage, LabVIEW has gotten far worse over the years, a really simple compiled exe can take up to 50 or 60 MB of memory. Again this is probably moot as we >have reached the stage where 2 GB of RAM is pretty much standard these days (and dirt cheap).
 
I may probably also suspect my 500MB of RAM??
 


Message Edited by Parny on 05-19-2008 08:31 PM
0 Kudos
Message 6 of 8
(2,676 Views)
0 Kudos
Message 7 of 8
(2,654 Views)

Check the processes that are running.  I'm sure Labview is using only a portion of that.

I can't complain about LV using up more resources than past versions.  After all, it does have more features.  And that should not affect the reliability for long term running of the VI.

Have you thought of uninterruptable power supply (UPS) - power backup - and of something that warns you if your code stops running, for unknown reason?  It is possible to create code that monitors for heartbeats from your application.  That way, if it does stop, theis independently running application can give you a warning and it minimizes downtime.

RayR

0 Kudos
Message 8 of 8
(2,635 Views)