11-28-2012 04:36 AM
Dear Colleagues,
Please help me to solve one problem:
My program is intended for reading from network SQL database about 70 000 rows (in one row about 20 cells) in table control (see my code attached here, but need Database toolkit).
So after reading (approx. 10 sec) so many data (LV after it occupy ohh !! 800 MegaBytes !!) user must be highght row it needed him (see event)... So after it my table control begins so slowly working.
You know, that at my PC the same functions are working properly and quickly in the C++ program!
So now I don't know how I must write the LV code in order to provide this.
Moreover, I think LabVIEW is intended only for education purposes and no for other. Learn C++ and to you will be happiness.
11-28-2012 05:37 AM - edited 11-28-2012 05:38 AM
@Current_93 wrote:
...
Moreover, I think LabVIEW is intended only for education purposes and no for other. Learn C++ and to you will be happiness.
This is one of the funniest quote. 😄
LV didn't occupy 800 MB of memory the data you are loading takes that much of space. You have used 15 Local variables and by this you have multiplied the data so thats the reason for the sluggishness. Program it properly then you will feel the difference.
11-28-2012 05:54 AM
Excuse me, but tomorrow I do for you a screenshot that appears for me my TaskManager - 800 MB, and 15 local variables so many memory can not occupy.
11-28-2012 06:25 AM - edited 11-28-2012 06:27 AM
I will try to give explanation based upon this (correct me if I am wrong)
Let say as you said 70,000 rows and 20 cells so your table may consist of 70,000 x 20 = 1,400,000 string spaces. Considering you have a string of length 4 so according to the link provided a string takes 10 + the length in bytes so each cell takes 14 bytes of data. So 1,400,000 x 14 = 196,00,000 bytes of data in 1 copy so multiply that with 15 of your local variables gives you 2,940,00,000 which is equal to 294 MB of memory. so when the length of your string increases obviously the memory occupied by the your data will increase.
11-28-2012 06:34 AM
I've changed my code and I leave one local rt_meas variable - but nevertheless - 800 MB occupy.
Sorry but it seems to me that LV life of it's own
11-29-2012 07:09 AM
Dear colleagues,
Now I want to prove to you that the LabVIEW has a life in spite of the rules.
See the same code attached below but it has not any local variables. Even in this case my exe build occupy 800 MB ! (See the screenshot attached here).
So I'm right. I am sure that very few people know how to solve this problem. This is not a problem, it is a normal situation for LV - rules are not working.
Moreover nobody knows how deallocating programmatically these 800 MB - it is a fantastic, I can not to do it.
11-29-2012 07:49 AM
Hi current,
sorry to say, but your VIs use way too much sequences and duplicate code.
And I do find several locals, not all are needed.
- Do you really need SharedVariables?
- When providing a ZIP with a handful of VIs you should give the name of the main VI instead of let us search for it...
- clean up your code (like put duplicate code sequences in subVIs, merge property nodes of the same control instead of using several of them, merge IndexArray nodes when accessing the same array, a lot more) and we will have a look at it again...
11-29-2012 07:58 AM - edited 11-29-2012 08:06 AM
Thank you Gerd,
Your suggestions are appreciated, thank you, but I think that the value of 800 MB has not very changed... we'll try.
I was most concerned about how I can to deallocate programmatically these 800 MB.
11-29-2012 08:05 AM
i made a multicolums listbox with 16000 rows and 4 columns....very slow 😞
i changed my listbox with a classic style mulicolumn listbox....it works in a perfect way 🙂
PS: don't use array, only string...and then before the output transform the string in array (spreadshet to array block)...let me know if it will be better 🙂
11-29-2012 08:09 AM - edited 11-29-2012 08:12 AM
Ohh yes Gigi85!
I forget about it! All "Classical" may help me.
But "Only string" - ??? I do not quite understand... from SQL query I receive an array.