03-22-2013 10:24 AM
Hi everybody. Here is the code on g#, which fill ram with about 1gb. And I think the problem is with serialize method. I need your help.
03-22-2013 12:12 PM
Hi Davkh,
I tried to repeat your problem, but can't see any problem. I don't get any strange memory issues at all. What versions of LabVIEW, OS and G# are you using?
Mattias
PS
Please notice that there were a fix in Deserialization of the G# Framework 1.4.5 release
From Release Notes:
G# Framework 1.4.5
G# 1.5.1
* Bugfix in Deserialize() for XML. Clusters were not correctly parsed. Removed support for non-matching XML structures.
* Removed XMLIgnoreList().
-----------------
03-22-2013 12:48 PM
Please check test.vi. Put size to 10M. And some file path. When you run this vi, the 700mb ram memory is used and not cleared after the vi is finished.
03-23-2013 04:32 AM
Hi,
Yes, I do see that LabVIEW increases memory. I do believe that LabVIEW is forced to create a lot of extra data copies. A known issues with LabVIEW. I do see one improvement I can do. In the serialization VI, please put a case structure around the "GetAggregatedObjects" VI as seen below. This is a very heavy recursive algorithm and is actually not need if "include aggregates" isn't checked. Memory decrease a lot with this fix. In your code, please set "include aggregates" to FALSE. I will include this fix in the next release of G#.
Another option you have if memory is a problem is not to use an array directly as a an G# attribute, but put a DVR references to the array instead. Then, you can actually override the serialize and deserialization in G# and create your own serializer/deserialize (the G#Object serializer VIs are dynamic dispatch). See the attached modified example called "Test_2.vi" with the TestClass2.lvclass. Notice that I also fixed the property that read the array.
I hope this help.
Thanks,
Mattias
Message was edited by: Mattias_Ericsson
Image was wrong. Here is the correct from the upcoming release.
03-23-2013 11:01 AM
Could you please create for LV 2011. I'm using this version, so I can't open the project.
Thanks,
03-24-2013 03:02 AM
Hi,
Oh, sorry. Here is a LV2011 version.
Mattias
03-24-2013 03:22 AM
Thanks for interesting solution.