10-24-2011 11:38 AM
Hi All,
I've been developing a fairly large application - when started up and idling it uses about ~200MB of RAM in the task manager. I recently refactored it slightly and as part of the refactor I included some OO code. This code is very simple - reading and writing to and from a small cluster by reference.
Despite making very small changes the size of my code has jumped up from ~200MB of RAM to ~450MB RAM. Before I start looking elsewhere has anyone else seen a similar effect when using LVOOP? For example is there some kind of LVOOP framework being used by my code now which is quite memory intensive? Or have I simply screwed up elsewhere and am trying to blame the new thing......
Thanks,
Dave
10-26-2011 03:36 AM
Hi Dave,
As far as I'm aware using LVOOP shouldn't increase your memory usage by that much, but to be sure if you can post your code please, (including any subVIs that you have made) then I can have a look and see if I can identify what's causing the issue.
It would also be usful if you could post a version of your code from before you made the changes please, if you still have it.
Kind regards,
10-26-2011 06:50 AM
Hi James,
Thank you for your comment and offer of a code review.
I have discovered my issue and as you suggested it is not related to LVOOP. When debugging my code I have a habit of stopping the code where I find bugs and setting current front panel values to default. This allows me to work on just the subVI when making changes without requiring me to restart the entire application. After refactoring my code this actually resulted in a number of large arrays being populated on frontpanel subVIs and taking up memory when I opened my application.
I wrote a rough and simple VI to programatically reset all my front panel arrays to empty arrays. This reduced my project size back down to the approximately 200MB it was originally.
I've attached the VI I wrote in case it is of use to the community - I'm sure there is a better way to do this but my code does work The code uses OpenG and is written in LV2009SP1
Also if anyone is aware of an easier way to do this - such as an option to empty all front panel arrays for an entire project - I'd be obliged if they could shout out.
Thanks again,
Dave