Muni Posted July 7, 2009 Report Share Posted July 7, 2009 Dear All, I developed a application software for third party instuments using Labview 7.1. In my code there many while loops having its own time delay. After running the application the program occupying the most of the system memory. What could be the solution. Thank u all, Regards, muni Quote Link to comment
Aristos Queue Posted July 7, 2009 Report Share Posted July 7, 2009 After running the application the program occupying the most of the system memory. After running --- by this I assume you mean that the VI has come to a complete stop and yet lots of memory is still being used. If the VI is still running, there are lots of things that could be taking up memory that we could talk about. But after a VI finishes, here's the list: You could simply have a very large VI hierarchy. When you load the VIs into memory for the first time, look at how much memory is being used. It could be that it is already using lots of memory. That probably isn't your problem -- it takes a lot of VIs to make an impact like that, but I have seen some apps get big enough that their raw code size is huge. When the VI finishes running, what front panels are open? Every open front panel will store data in its controls/indicators. If you have lots of panels open and a giant array or a long long long string gets passed through those VIs while the VI is running, every single control/indicator that shows the array/string will have stored a copy of that array/string as part of its display. The dataspaces of VIs expand to contain the data that passes through them (large arrays, large strings), just like the front panel, and LV does not deallocate that space on the assumption that if you're leaving the VI open, you are probably going to run the VI again and the second execution will be faster because memory is already allocated for data of that size. You can use Tools>>Profile to see which subVIs are getting to be the largest. Consider dynamically loading and unloading those subVIs --- open the VI that calls the subVI and then pop up on the subVI node call and select "Call Setup...". In the dialog that appears, click "Reload for each call". Hope that helps. Quote Link to comment
George Pollock Posted July 9, 2009 Report Share Posted July 9, 2009 Look into your code and see if you are either building arrays by just stacking data on them or you are building strings by concatenation. Both leave you open to inheriting the C problem of memory leakage. Much better to declare arrays of fixed size and then fill them, declare strings of fixed size and then insert characters. More work but no leaks. Quote Link to comment
Clio75 Posted August 15, 2009 Report Share Posted August 15, 2009 I developed a application software for third party instuments using Labview 7.1. In my code there many while loops having its own time delay. I don't know if this is the case here , but my experience with code written in old LW, and upgraded to new is mixed. I have some old code written in and old LW7 that in strange way don't work in LW 8.6. But If I write(draw) new code that to me seems exactly the same starts working. why?? I DON*T KNOW. I have just excepted the fact. Good loock Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.