09-22-2009 09:11 PM
I am doing extensive reading of the Ethernet socket and data processing. When I keep the mouse pushed over the panel it runs ok. As soon As I let it go it slows down to like one cycle per second. I have 4x2.4GHz Intel and 4GB RAM. Task manager does not show any ovewhelming CPU usage. Kepping the mouse button on the bottom taskbar application helps as well.
Why does it happen and how to fight it? thanks
Solved! Go to Solution.
09-22-2009 09:26 PM
can you post the vi so we can see what is happening?
09-23-2009 09:11 AM
09-23-2009 12:09 PM
My first guess is that you are growing an array endlessly. As it gets larger, LabVIEW needs to juggle memory to find an ever growing space to store it. The other possibility is a string concatenation you have going on in the middle of the lower loop where you are concatenating more and more data to a string and storing it in a shift register.
09-23-2009 01:30 PM
09-23-2009 03:45 PM
Ravens Fan wrote:My first guess is that you are growing an array endlessly. As it gets larger, LabVIEW needs to juggle memory to find an ever growing space to store it. The other possibility is a string concatenation you have going on in the middle of the lower loop where you are concatenating more and more data to a string and storing it in a shift register.
I think I made the arrays fixed size. Initally I did not and it did not work.
The way it works is I get a long string, need to throw out the header, then I store the values into arrays one by one. Based on certain criteria I throw some of them out so the array is almost never full, then I process the data in the array.
I ll check if the memory usage goes up. Could you be more specific as where the problem could be? I concate things more than once. thanks
09-23-2009 03:47 PM
billko wrote:
Sounds like it might be a thread priority issue. When the mouse is over the application, the application gets a boost in priority, making it faster. Does this sound right?
That is what i thought but still I have no idea how to approach it. Sometimes is just fine without doing anything, The trick with pushing the mouse button over the panel olways works.
09-23-2009 04:06 PM
Ravens Fan wrote:My first guess is that you are growing an array endlessly. As it gets larger, LabVIEW needs to juggle memory to find an ever growing space to store it. The other possibility is a string concatenation you have going on in the middle of the lower loop where you are concatenating more and more data to a string and storing it in a shift register.
I just checked the memory usage. For 10 min it stayed still the CPU about 6-7% load. Labview does not allocate any extra memory(it seems like). The whole system actually went dow from 915MB to 913MB RAM usage.
09-23-2009 04:31 PM
09-23-2009 04:43 PM
AndyN wrote:
billko wrote:
Sounds like it might be a thread priority issue. When the mouse is over the application, the application gets a boost in priority, making it faster. Does this sound right?That is what i thought but still I have no idea how to approach it. Sometimes is just fine without doing anything, The trick with pushing the mouse button over the panel olways works.
I once used a Timed Loop (with the stop button wired to stop after the first iteration) to allow me to play with the code's processor affinity and priority. Id be interested to see if that changes anything.