Memory Problem

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
lunjunk
Posts: 3
Joined: Tue Jan 27 2004

Memory Problem

Post by lunjunk »

Hi everyone,

Our company needs to print hundreds of report each day and we create our pdfs using Amyuni PDF Convertor 2.08b Pro and print with crystal report 9 for our ASP.NET application (.Net F/w 1.0).

But everyday we face the same problem of "system out of memory" because the service "aspnet_wp.exe" continues to grow and eventually crashes. We found that the problem comes from Amyuni because it works fine using crystal report pdf convert (But we have other issues that stopped us from using it)

We have tried everything to release memory but no improvement.
Pls advise. :oops:

Alan


I did a little test, as it loops through and generate 100 reports.
The result was terrifying

Code: Select all

Version      Init Start (K)       100 reports (K)     Increased(K)
-------------------------------------------------------------------------
2.08             44,260                250,536             206,276
2.10h Eval       46,792         crashed on 84 reports        --      

Code: Select all

-----------------------------------------------------------
' Source code
-----------------------------------------------------------

Private Sub btnConvert_Click() Handles btnConvert.Click
Dim i As Integer
For i = 0 To 99
  ConvertReport()
     Next
     GC.Collect()
End Sub



Private Sub ConvertReport()

    Dim dsAppData As New DataSet
    dsAppData.ReadXmlSchema("c:\ads_schema.xsd")
    dsAppData.ReadXml("c:\ads_data.xml")

    crReportDocument = New ReportDocument()
    crReportDocument.Load(Server.MapPath("reports\") & "rpt_tmp.rpt")
    crReportDocument.SetDataSource(dsAppData)

    CrystalReportViewer1.ReportSource = crReportDocument
    Dim ExportPath As String = "c:\"

    Dim pdf As New CDIntfEx.CDIntfEx()
        ' Initialize amyuni printer driver
         pdf.DriverInit(AmyuniPrinterName)
         pdf.EnablePrinter(Amyuni_Licensee, Amyuni208Key)
         pdf.SetDefaultPrinter()
         pdf.FileNameOptionsEx = NoPrompt + UseFileName + EmbedFonts
         pdf.DefaultFileName = ExportPath + CStr(Now.Ticks) + ".pdf"

         crReportDocument.PrintOptions.PrinterName = AmyuniPrinterName
         crReportDocument.PrintToPrinter(1, False, 0, 0)

         crReportDocument.Close()
         crReportDocument.Dispose()
         crReportDocument = Nothing

         pdf.DriverEnd()
         System.Runtime.InteropServices.Marshal.ReleaseComObject(pdf)
         pdf = Nothing

End Sub
baggihung
Posts: 1
Joined: Fri Jan 30 2004

Post by baggihung »

Hi lunjunk,

My team is facing exactly the same problem as you. :cry:

We are using Amyuni PDF Convertor 2.08b and Crystal Report Version 9 on .NET framework 1.1, and we have to use the amyuni convertor because there some fonts cannot be exported by crystal report directly. Our program is quite similar to your ConvertReport function.

In our system, the aspnet_wp.exe process grows 1.5Mb steadily on every calling to the "PrintToPrinter" function on the crystal report object. The memory cannot be released by GC even we have waited for a long long time. We have consulted Microsoft and they reported that some unmanged space allocated by acpdf208.dll cannot be released and there is no solution until now.

I have downloaded the trail version of Amyuni PDF Convertor 2.10h and with the Crystal Report 9 SP2 installed, but both don't help.

Amyuni tech team, Please advise....

Anthony
lunjunk
Posts: 3
Joined: Tue Jan 27 2004

Solution

Post by lunjunk »

Hi Anthony,

I have a solution to the problem.

I've use another pdf conversion program and now works fine, with better performance and memory management. Find a product that support server-level requirement or you will be facing the same problem. If you need more info, feel free to contact me. I'm in CS3

Alan.
Post Reply