03-15-2010 04:23 AM
hai guys,
Im currently developing a code that run 24 hours 7 days a week. My problem is the execution time increases as days pass by. As im tracing down the execution time ,the 1st day i start the to run the program execution time is 0.04 second but after 3 day it increases to 4.5 seconds .
then i indually tracked down the subvi that causing problem and find out that the problem is on writing to ini file.
The subvi function is to REPLACE the data (20 data )in a file every 10 second*not accumulating data just replace the old data . I open file replace data and close file every itteration and as day pass the execution time for this subvi increases.
Can any one help me to get a solution for the problem as time is a very important factor in my programming. the execution time is limited for less that 10 second.
thanks
regards
kokula
03-15-2010 04:51 AM
Hi Kokula
Any chance you can post the code? Also, have you checked the memory consumption of your application while it runs? You can do this with the taks manager. Check if it is steadily growing as time passes.
Best Regards
David
NISW
03-15-2010 08:07 PM
03-15-2010 09:52 PM
hai dave,
I check the memory consumption and its increasing gradually. started with 47MB and in 1 day wen up to 350MB and its gradually increasing.
the ram usage also increasing. Will dealocate memory play a role in this(dealocate memory every day????)
regards,
shamaran
03-15-2010 11:14 PM
As David said, post the code.
Is there any reason why your are loggin to an .ini file? Does that mean you are using the LabVIEW config file functions?
I don't know if deallocating memory would help, or is even possible, without seeing your code. You either have a problem with resources continuously being created, but not being closed out. Or you have an ever growing array. This takes more memory over time, and slows down the code because LabVIEW has to move memory around to account for the ever larger array.
I bet if you let your program run long enough, it would eventually crash due to running out of memory.
By the way 47MB to 350 MB of memory consumption means the same thing as RAM usage increasing.
03-16-2010 03:48 AM
Hi shamaran
I agree with everything Ravens Fan said. If you have the Desktop Execution Trace Toolkit you can monitor the memory allocations/deallocations your program makes and see where the increase is happening. Otherwise, the only way we can help you is if you post the code so we can have a look.
Best Regards
David
03-16-2010 05:05 AM - edited 03-16-2010 05:06 AM
Hi!
Are you closing the file reference properly? Or are you opening a new reference each call?
If not this is a source of memory loss.
Greets CR