Out of Memory exception

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  Out of Memory exception

DynamicPDF CoreSuite for .NET (v5) Forum

 Aug 17 2010 11:40 AM
Hi,

I've just been reading the previous thread reqarding the out of memory exception (http://www.DynamicPDF.com/Forums/DisplayThread.csp?ForumId=17&ThreadId=2560), I'm also getting the error intermittently and not necessarily with large files. Usually I just rerun the request and it works, but I've just had an instance where by the error was raised repeatedly, eventually I restarted the DynamicPDF Converter service and then it worked okay. I also noticed that there were two instances of "ceTe.DynamicPDF.Converter.Service.exe" running in the processes list <-- is this right?

Regards Allan

System.Exception: Conversion failed ---> System.Exception: Error in loading the image ---> System.OutOfMemoryException: Out of memory.
   at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
   at System.Drawing.Image.FromFile(String filename)
   at b8.a(Object A_0, EventArgs A_1)
   --- End of inner exception stack trace ---
   at b9.a(l A_0, l A_1)
   --- End of inner exception stack trace ---
   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)
   at cr.b.b()
   at cr.a(Byte[] A_0)
   at cr.a(Object A_0)

Stack trace:    at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
   at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure)
   at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
   at PDFConversionService.ConvertToPDF(String sInputFolderPath, String sUserFolder) in F:\websites\services\pdfcs\PDFConversionService.aspx.vb:line 200

Inner exception: System.Exception: Conversion failed ---> System.Exception: Error in loading the image ---> System.OutOfMemoryException: Out of memory.
   at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
   at System.Drawing.Image.FromFile(String filename)
   at b8.a(Object A_0, EventArgs A_1)
   --- End of inner exception stack trace ---
   at b9.a(l A_0, l A_1)
   --- End of inner exception stack trace ---
   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)
   at cr.b.b()
   at cr.a(Byte[] A_0)
   at cr.a(Object A_0)

Inner exception stack trace:    at a3.a(Object A_0)
 Aug 17 2010 3:28 PM
Posted by a ceTe Software moderator
Hello,

The Converter process should only show up once in the list of processes. Can you please download and try the latest build from the website that was released early this week? It has few bug fixes and also has logging capabilities that will enable us to troubleshoot this more effectively.

Thanks,
ceTe Software Support Team
 Aug 18 2010 7:31 AM
Hi,

Thanks for your reply. I've uninstalled and reinstalled -

Merger - DynamicPDF512forNETBuild15141.msi
Converter - DynamicPDFConverterv100forNETBuild16128x86.msi

Are these the latest versions?

I've updated the references to the dlls in my project (ceTe.DynamicPDF.20.dll, ceTe.DynamicPDF.Converter.20.dll)

Deployed and run a test through the converter and I've still got two instances "ceTe.DynamicPDF.converter.service.exe" in the processes tab of task manager.

Do you have any advice for implementing the logging you mentioned?
 Aug 18 2010 1:22 PM
Posted by a ceTe Software moderator
Hello,

You are seeing two instances of the "ceTe.DynamicPDF.Converter.Service.exe" in the processes tab of Task Manager because one is the manager process and other is the actual conversion process. One is the actual service and other is invoked by the service on receiving the first conversion request. Conversion process gets recycled every 1000 conversions, which can be modified by changing the value of the conversionsPerProcess attribute in the ceTe.DynamicPDF.Converter.Service.exe.config file.

To enable logging, please follow the steps below:

1. After installation, Open the Service Config file under the Service folder (ceTe.DynamicPDF.Converter.Service.exe.config)
2. Edit the enableLogging property and set to "true"
3. Re-start the DynamicPDF Converter service from Administrative Tools --> Services
4. The log file will be created under %windir%\temp. DynamicPDFConverter.log will be created if no errors occur and DynamicPDFConverterONLOGERROR.log will be created if there are errors.

Send us the log file that gets created and that will help us troubleshoot this more effectively.

Thanks,
ceTe Software Support Team
 Aug 19 2010 5:09 AM
Hi,

Thanks for the help I've just had the out of memory error again and here is the log file which

DynamicPDF Converter Log file.
Log created on : 2010-Aug-19 10:02:25

Operating system version :Microsoft Windows NT 5.2.3790 Service Pack 2, v.4035
Platform :x86
Service Pack :Service Pack 2, v.4035

IE Version :6.0.3790.2825
CLR Version :2.0.50727.1433
Meachine Name :CW2
634178089451081542        Form Service        Started intializing run method
634178089451237792        Form Service        Completed setting up intial params... Entering for client lookups..
634178090387175292        Form Service        Started new process for conversion. Process id 6288
634178090389050292        From Con.Pro        Received new request from service. Placing the request for conversion.
634178090389362792        From Con.Pro        Creating new app domain for the IP file F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file01.doc
634178090395769042        From Con.Pro        Identifying the conversion file type...
634178090406237792        From Con.Pro        Conversion type is a1, Text: a1
634178090417175292        From WORD CL        Completed creation of document instance. Input file F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file01.doc
634178090437331542        From OFF. CL        Document feeded for PDF printingC:\WINDOWS\TEMP\1c030B.tmp.0.doc
634178090438581542        From Con.Pro        Conversion success. Input file F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file01.doc

Output file E:\wwwvirtual\PDFConv\ca97793240624940a2e94b628\pdf\MyNewDocument.pdf
634178090480144042        From Con.Pro        Conversion completed for Inputfile F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file01.doc
634178090482956542        Form Service        Started new process for conversion. Process id 3140
634178090484831542        From Con.Pro        Received new request from service. Placing the request for conversion.
634178090484987792        From Con.Pro        Creating new app domain for the IP file F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file02.tif
634178090490925292        From Con.Pro        Identifying the conversion file type...
634178090501237792        From Con.Pro        Conversion type is ah, Text: ah
634178090528112792        From Con.Pro        Conversion success. Input file F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file02.tif

Output file E:\wwwvirtual\PDFConv\ca97793240624940a2e94b628\pdf\MyNewDocument.pdf
634178090528269042        From Con.Pro        Conversion completed for Inputfile F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file02.tif
634178090528425292        From Con.Pro        Received new request from service. Placing the request for conversion.
634178090528425292        From Con.Pro        Creating new app domain for the IP file F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file03.tif
634178090534987792        From Con.Pro        Identifying the conversion file type...
634178090540612792        From Con.Pro        Conversion type is ah, Text: ah
634178090561862792        From Con.Pro        Conversion success. Input file F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file03.tif

Output file E:\wwwvirtual\PDFConv\ca97793240624940a2e94b628\pdf\MyNewDocument.pdf
634178090562019042        From Con.Pro        Conversion completed for Inputfile F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file03.tif
634178090562175292        From Con.Pro        Received new request from service. Placing the request for conversion.
634178090562175292        From Con.Pro        Creating new app domain for the IP file F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file04.tif
634178090569050292        From Con.Pro        Identifying the conversion file type...
634178090574675292        From Con.Pro        Conversion type is ah, Text: ah
634178090579050292        From Con.Pro        Error on conversion. Inputfile is F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file04.tifSystem.Exception: Error in loading the image ---> System.OutOfMemoryException: Out of memory.
   at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
   at System.Drawing.Image.FromFile(String filename)
   at ah.a(Object A_0, EventArgs A_1)
   --- End of inner exception stack trace ---
   at bc.b(ac A_0, ac A_1)
634178090579050292        From Con.Pro        Conversion completed for Inputfile F:\websites\services\PDFCS\input\ca97793240624940a2e94b628\file04.tif

Regards Allan
 Aug 19 2010 8:47 AM
Posted by a ceTe Software moderator
Hello Allan,

Please try converting only the tiff image file to PDF using our DynamicPDF Converter product and see if it works for you?

Can you please send over the Tiff image which you are using for conversion process to our Support Teamso that we can do some testing on our end by setting up the similar environment? This will help us to find the cause for the error.

Thanks,
ceTe Software Support Team
 Aug 20 2010 12:03 PM
Hi,

I've managed to convert just the tiff ok, plus when I run this directly on the server it all converts okay when I run it from the network, there is a delay in the file delivery. I've also add a convert to jpg for tiff's which has reduced the file sizes massively which has also helped.

I've been struggling to put together a routine to check the file delivery as the file.exists and file.length >0 return true even though the file isn't completely accessible.

Allan
 Aug 20 2010 2:07 PM
Posted by a ceTe Software moderator
Hello Allan,

Can you please explain what exactly you mean by delay in file delivery? Is it delay in generating the output PDF after the conversion or delay in accessing the source file for conversion?

So TIFF conversion is working fine for you? Is there anything on our end that we need to troubleshoot further?

Thanks,
ceTe Software Support Team
 Aug 23 2010 11:24 AM
Hi,

We have a 3 server failover system with a master server which holds all the web files, any editing is done on the master and replicated to the 3 failover servers using a realtime replication tool called doubletake. We have a service which polls the three servers and if it doesn't get a response from any one of them it changes the dns records to point to one of the servers that is up.

So sometimes there can be a short lag in the replication especially if the network traffic is high.

My tests seem to indicate that if I call the conversion routine before all the files have replicated completely I get this out of memory error. If I put in a long enough pause between copying the files and calling the conversion process if works okay.

The out of memory error is somewhat misleading.

As I mentioned in my previous post I'm having a bit of trouble figuring out a reliable method of establishing if a file is truly available for processing.

Regards Allan

 Aug 23 2010 12:05 PM
Posted by a ceTe Software moderator
Hello Allan,

Can you please check if the file exists in the server where you are converting the file before calling the conversion method? This may solve the problem. If the file exists then you can convert it and if it is not exists then you may have to keep the files so that you can convert them.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 4:00 AM.