XslTransform memory overload - XML SOAP

This is a discussion on XslTransform memory overload - XML SOAP ; Hi. I'm using XslTransform to transform a XML resulting of a Dataset into a Excel spreadsheet. But the object is not releasing its resources while transforming and I'm getting OutOfMemory errors. The memory consumed by the process exceeds the size ...

+ Reply to Thread
Results 1 to 4 of 4

XslTransform memory overload

  1. Default XslTransform memory overload

    Hi.

    I'm using XslTransform to transform a XML resulting of a Dataset into a
    Excel spreadsheet.
    But the object is not releasing its resources while transforming and
    I'm getting OutOfMemory errors.

    The memory consumed by the process exceeds the size of 306 MB and the
    IIS process is recycled, resulting in a "Server Application
    Unavailable" error message. The size of the XML result might be 15MB.

    The memory of process grows during de Transform method call.

    I've already tried use a FileStream to keep memory free but has no
    effect.

    Any ideas?
    Thanks.


  2. Default Re: XslTransform memory overload



    arochax wrote:

    > I'm using XslTransform to transform a XML resulting of a Dataset into a
    > Excel spreadsheet.
    > But the object is not releasing its resources while transforming and
    > I'm getting OutOfMemory errors.
    >
    > The memory consumed by the process exceeds the size of 306 MB and the
    > IIS process is recycled, resulting in a "Server Application
    > Unavailable" error message. The size of the XML result might be 15MB.
    >
    > The memory of process grows during de Transform method call.


    Which overload of the Transform method exactly do you use, could you
    show the code how exactly you call the Transform method, what kind of
    arguments you pass in? Have you debugged that stylesheet outside of an
    ASP.NET/IIS application to check whether there are no problems with the
    stylesheet? What's the size of the input XML?

    --

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

  3. Default Re: XslTransform memory overload

    Would you please share your code and data? We will look at it.

    Thanks,
    Zafar
    <arochax> wrote in message
    news:1144164604.894729.12200@z34g2000cwc.googlegroups.com...
    > Hi.
    >
    > I'm using XslTransform to transform a XML resulting of a Dataset into a
    > Excel spreadsheet.
    > But the object is not releasing its resources while transforming and
    > I'm getting OutOfMemory errors.
    >
    > The memory consumed by the process exceeds the size of 306 MB and the
    > IIS process is recycled, resulting in a "Server Application
    > Unavailable" error message. The size of the XML result might be 15MB.
    >
    > The memory of process grows during de Transform method call.
    >
    > I've already tried use a FileStream to keep memory free but has no
    > effect.
    >
    > Any ideas?
    > Thanks.
    >




  4. Default Re: XslTransform memory overload

    Thanks for answer.

    How can I debug stylesheet outside of an ASP.NET/IIS application ?

    The fonts are below:

    The transform code: --------------------------------------

    Private Function GetExcelXML(ByRef dts As DataSet, ByVal XSLT As
    String) As Stream

    Dim xmlDoc As New XPath.XPathDocument(New
    StringReader(dts.GetXml))
    Dim xslTran As New Xsl.XslTransform
    Dim xmlStream As New FileStream(Server.MapPath("buffer.tmp"),
    FileMode.Create)
    Dim xmlTW As New XmlTextWriter(xmlStream,
    System.Text.Encoding.UTF8)

    dts = Nothing 'release memory of dataset

    xmlTW.Formatting = Formatting.Indented
    xmlTW.Indentation = 1
    xmlTW.WriteStartDocument()

    xslTran.Load(NomeArqXSLT)
    xslTran.Transform(xmlDoc, Nothing, xmlTW, Nothing) 'here
    the memory increase too much

    Return xmlStream
    End Function


    XSLT file: --------------------------------------

    <xsl:stylesheet version="1.0"
    xmlns="urn:schemas-microsoft-comffice:spreadsheet"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:user="urn:my-scripts"
    xmlns="urn:schemas-microsoft-comfficeffice"
    xmlns:x="urn:schemas-microsoft-comffice:excel"
    xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet">
    <xsl:template match="FloorSpaceDetalhe">
    <Workbook xmlns="urn:schemas-microsoft-comffice:spreadsheet"
    xmlns="urn:schemas-microsoft-comfficeffice"
    xmlns:x="urn:schemas-microsoft-comffice:excel"
    xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet"
    xmlns:html="http://www.w3.org/TR/REC-html40">
    <Styles>
    <Style ss:ID="Default" ss:Name="Normal">
    <Alignment ss:Vertical="Bottom" />
    <Borders />
    <Font />
    <Interior />
    <NumberFormat />
    <Protection />
    </Style>
    <Style ss:ID="s21">
    <Font ss:Bold="1" />
    <Alignment ss:Horizontal="Center" ss:Vertical="Bottom" />
    </Style>
    </Styles>
    <Worksheet>
    <xsl:attribute name="ss:Name">Floor Space Detalhado</xsl:attribute>
    <Table>
    <Row>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Categoria</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Sub-Categoria</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Capacidade</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Marca</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Modelo</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Data</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Rede</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Cidade</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Estado</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Loja</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Tipo Loja</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Promotor</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Coordenador</Data>
    </Cell>
    <Cell ss:StyleID="s21">
    <Data ss:Type="String">Lojas da Rede</Data>
    </Cell>
    </Row>
    <xsl:apply-templates select="Dados" />
    </Table>
    </Worksheet>
    </Workbook>
    </xsl:template>
    <xsl:template match="Dados">
    <Row>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsCategoria" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsSubCategoria" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsCapacidade" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsMarca" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsModelo" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dtFloorSpace" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsRede" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsCidade" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="cdEstado" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsLoja" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsTipoLoja" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsUsuario" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">
    <xsl:value-of select="dsCoordenador" />
    </Data>
    </Cell>
    <Cell>
    <Data ss:Type="Number">
    <xsl:value-of select="LojasRede" />
    </Data>
    </Cell>
    </Row>
    </xsl:template>
    </xsl:stylesheet>


    XML Source: --------------------------------------
    ---->>> In my source, the number of records (Dados) is 23983.

    <FloorSpaceDetalhe>
    <Dados>
    <dsCategoria>Freezer horizontal</dsCategoria>
    <dsSubCategoria>Residencial</dsSubCategoria>
    <dsCapacidade>De 251 a 350 litros</dsCapacidade>
    <dsMarca>Metalfrio</dsMarca>
    <dsModelo>DA301</dsModelo>
    <dtFloorSpace>16/02/2006</dtFloorSpace>
    <dsRede>Ricardo Eletro</dsRede>
    <dsCidade>Betim</dsCidade>
    <cdEstado>MG</cdEstado>
    <dsLoja>8</dsLoja>
    <dsTipoLoja>Rua</dsTipoLoja>
    <dsUsuario>Andrea Beatriz Maciel </dsUsuario>
    <dsCoordenador>Valéria Andrade</dsCoordenador>
    <LojasRede>9</LojasRede>
    </Dados>
    </FloorSpaceDetalhe>


+ Reply to Thread

Similar Threads

  1. Memory&Time overload in sending smtp gmail with big attach
    By Application Development in forum RUBY
    Replies: 0
    Last Post: 11-29-2007, 04:14 AM
  2. Re: XslTransform, XslCompiledTransform Sum Large Number Rounding Probl
    By Application Development in forum XML SOAP
    Replies: 2
    Last Post: 12-03-2006, 10:57 PM
  3. How to make XslCompiledTransform transform &amps; as XslTransform does
    By Application Development in forum XML SOAP
    Replies: 12
    Last Post: 11-07-2006, 02:55 AM
  4. Replies: 3
    Last Post: 03-31-2005, 01:09 PM
  5. What makes VB.Net XslTransform REALLY REALLY SLOW?
    By Application Development in forum DOTNET
    Replies: 7
    Last Post: 09-20-2004, 04:53 PM