I have a very big problem and after one week I have no idea if there is a solution for that problem at the end.
Over the last 15 months I developed a simulation tool that ends up with some stacked barplots (~100 bars of 6 single stacked bars). Now I have to create ~ 4500 pictures (or screenshots) of the different results...to use them in a web application. The problem: after creating 80 pictures the LabVIEW application is out of memory (error 402901 @ View.vi). Even if I don´t show the pictures and only save them, a out of memory problem occurs. Even if do the picture generation it in a SubVI and deallocate the memory after a single plot. The max number of pictures depends on the picture size if visible and the number of elements in the picture. Is there a other way to deallocate the memory after using the advanced plotting tool kit ?
Make my day with a good idea! Ralf
Thank you: I prepared a Vi for the discussion:
This is the subVI I want to call for 4500 times. The Array with the cluster inside on the left side has max.103 elements. The five "For Loops" on the left side (white) are only necessary to sort and name elements for the final picture.The green "For Loops" create max.103 stacked barplots and ~Text-labels.
The result is shown in the second jpg File.
After calling that subVI, I deallocate the memory in the main vi.
I can call the SubVi ~72 times... than the error occurs.
If I reduce the bars I can call it more often...
PS. The small SubVi under the second green For Loop is only writing the property node for the text labels,... couldn´t be the problem
It has the same effect on different computers
It has the same effect when I build an exe file
Taking a look into the Task Manager of Windows I see that the amount of memory the VI uses is increasing the whole time
Those are just pictures of your code, not a VI that can be improved and tested. 😉
I think that at sometime an error occurs somewhere in your code and you aren't handling the error. It might not be related to your plot at all. You are generating a huge string (APT just sends a formatted string to MatplotLib) but without error handling it would be hard to track down when and where it happens.
I'd suggest you use a program structure like the attached. Clean up your code and add it to the subvi. To clean up that code, use commonly accepted labview style guidelines to make it easier to understand. Inputs on left, output on right, wires run left-right as much as possible.
I want to follow your recommendations but actually I have no time because of other projects... I hope I can come back to that problem in October...
I am very sure that the error did not occur at another part of the code, but I will test it.
...commonly accepted labview style guidelines..
I reduced the code for a better understanding of the problem... without a clean up. Sorry.
Hopefully you can get it sorted out eventually.
If you have time, attach the actual VIs and some test data and I might be able to help.