95 views
in GUI Development by
Hi!
I'm receiving 100000 data each has 7MB from instrument side. I get this data in init() function of vertical list component. I call a native function and get the data to local array of variables and in the same init() function I'll assign them to array of global variables so that I can use them to load the vertical list in onLoad Item. Now my question is when I'm not viewing the vertical list, can I clear this memory occupied by these arrays? Will it be done in garbage collection? Since I'm working in embedded system, I'm concerned with the memory size occupied by this data. Please advise me on this matter.

1 Answer

0 votes
by

Hello ThanushiyahG,

the array is part of the superior object. Consequently, the array exists and occupies the memory as long as the object continues existing. As soon as the object is reclaimed by garbage collection the array is released too.

Usually, such data holding objects should be separated from other UI objects. You could manage the data array inside an autoobject, e.g. inside a Device Interface object. As long as the object is in use, its data (the array) will persist. In other words, if the GUI component displaying the data from the object is dismissed and released, the data holding object is released too.

Please note that the next time the data holding object is needed again and if it is not available anymore, you will need to reload the complete array. It will probably take long time. In the worst case, the original data is not available anymore so that reloading the arrays would be impossible.

I'm receiving 100000 data each has 7MB from instrument side.

My recommendation would be to manage such large amount of data in your middleware. Then the GUI limits to access the data records from the middleware. This would allow you to implement more efficient memory management for the data base. In Embedded Wizard an array occupies one continues memory area and its size is static. This makes the arrays less flexible if you plan to use them as storage for many data records.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...