DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory leak with large files and this code?

Okay, so the following code will not complete. 
 
Basically what I am doing is opening 5 files and generating a PDF document from the already opened Report file, which is renewed prior to the PDF export operation.  I left out the general stuff at the start.  I am also writing out the location of the PDF to a HTML file, which acts as an index of the exported PDF documents.
 
I believe it is due to some sort of memory leak issue, but it could be something else or just my code.  I have not stepped through this code, but for small file sizes of say less than 40 megs per file, it works fine.  For file sizes along these lines:
File 1 = 230 megs
File 2,3 = 26 megs
File 4,5 = 8 megs
 
it will belch erors at the end of about the 5th iteration through the For loop.  It will complete the 5th iteration however.  Here are the errors generated:
 
84   10/26/2006 9:35:15 AM Error:
85   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p1.TDM" file is invalid.
     (Error no. 6)
86   10/26/2006 9:40:19 AM Error:
87   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p2.TDM" file is invalid.
     (Error no. 6)
88   10/26/2006 9:45:17 AM Error:
89   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p3.TDM" file is invalid.
     (Error no. 6)
90   10/26/2006 9:53:07 AM Error:
91   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p8.TDM" file is invalid.
     (Error no. 6)
92   10/26/2006 10:00:39 AM Error:
93   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p9.TDM" file is invalid.
     (Error no. 6)
94   10/26/2006 10:01:01 AM Error:Error occured during file creation.
95   10/26/2006 10:01:01 AM Error:
     Error in <GM315 Pa...sing.VBS> (Line: 185, Column: 5):
     File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p1.TDM" file is invalid.
     (Error no. 6)
 
For files of a larger size, like:
File 1 = 7500 megs
File 2,3 = 80 megs
File 4,5 = 25 megs
 
This occurs after about 2-3 iterations through the loop.
 
see attachment for code.
0 Kudos
Message 1 of 11
(5,917 Views)

Hi Rich,

Please re-post your VBScript in a format where the character used as the space character (20) is NOT the same as the character used as the new line character.  I'd like to look over your VBScript and investigate this issue, but it would take me a while to manually sort through and replace some of the (20) characters with vbCRLF characters.

Brad Turpin
DIAdem Product Support Engineer
National Instruments 

0 Kudos
Message 2 of 11
(5,890 Views)
see attached full script.  Could you please reply once you have downloaded it?
Thanks.

Message Edited by RichElswick on 10-30-2006 08:37 AM

Message Edited by RichElswick on 10-30-2006 08:37 AM

0 Kudos
Message 3 of 11
(5,856 Views)

Hi Rich,

I downloaded the VBScript OK this time.  Could you please send over the smallest data file you have and the "GM315 BAS.TDR" layout so that I can run the script through?  I can beef up the data sets to the appropriate sizes after I see what the structure is.  My first job is to reproduce the error you are seeing.  Then we can start looking at how to avoid it now and/or fix it.in a future DIAdem version.

Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 11
(5,825 Views)
posting it up to the FTP server as Cobasys-p01.zip right now.  Should be there in about 5 minutes from now.
0 Kudos
Message 5 of 11
(5,823 Views)

Hi Rich,

I downloaded your application and made numerous modifications on my end, including inventing a dummy *.TDR file to make up for the one that your script loads.  I noticed that one of your DataFileLoad() commands invoked the "perl Pack msg220" DataPlugin, whereas the rest used the "CSV" DataPlugin.  I didn't have the "perl Pack msg220" DataPlugin, so I changed them all to be "CSV".  I ran this modified VBScript on my computer with the files you sent over 24 iterations without error.

I posted the edited application back to the web site-- try downloading it to a new directory and running it on your computer:

ftp.ni.com/outgoing/Cobasys-p01 Edited.zip

Let me know how that works for you,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 6 of 11
(5,799 Views)

i am having a similar error randomly inserted in the log 

 

25   10/1/2009 1:58:36 PM Error:
26   File handle for "C:\Program Files\Summitek\Spartan\data\tdm\S Parameter Test $SSN$ 49.TDMS" file is invalid.
     (Error no. 6)

and


31   10/1/2009 1:58:37 PM Error:
32   File handle for "C:\Program Files\Summitek\Spartan\www\temp\Test_$SSN$ 49_602313172.pdf" file is invalid.
     (Error no. 6)

 

it doesn't seem to be causing an immediate problem, but i have had several unexplained Diadem lockups.

 

they occur in log after i use CALL DATAFILELOADSEL and CALL PICpdfexport

 

help? what does this mean

 

jim

0 Kudos
Message 7 of 11
(5,182 Views)

Hi Jim,

 

What version of DIAdem are you using?  What version of LabVIEW created the TDMS file?  How much RAM memory does the Task Manager show is left when this happens?

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 8 of 11
(5,177 Views)

dd 11.1

executable built using lv 8.6.1

 

i show 580mb free ram

 

dd is using 95MB

jim

0 Kudos
Message 9 of 11
(5,174 Views)

Hi Jim,

 

We recently discovered that DIAdem 11.1 introduced a DIAdem memory fragmentation problem that was not present in previous versions and is also not present in the DIAdem 2010 code base.  So far the users who have run into this were all loading REPORT layouts with hundreds of pages-- how many pages were in the reports you were sending to PDF file?  This may not be the issue you're running into, but if you have hundreds of REPORT pages in DIAdem 11.1, it probably is.

 

Brad Turpin

DIAdem Product

National Instruments

0 Kudos
Message 10 of 11
(5,145 Views)