Byron | 6 Jun 22:16

xml.dom.pulldom using excessive memory

The following jython script fails on trunk with a OutOfMemoryError exception, but works with jython 2.2.1.  If trunk is run with -Xmx128M then it works.. but this seems excessive for the given script.

import xml.dom.pulldom

xmlf = file("tmp.xml", "w")
xmlf.write("<foo>\n")
for i in range(1, 8000):
   xmlf.write("  <data>%s</data>\n" % i)
xmlf.write("</foo>\n")
xmlf.close()

xmldoc = xml.dom.pulldom.parse("tmp.xml")
event, dbnode = xmldoc.getEvent()

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jython-dev mailing list
Jython-dev <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev
Leo Soto M. | 7 Jun 03:11

Re: xml.dom.pulldom using excessive memory

On Fri, Jun 6, 2008 at 4:19 PM, Byron <bvftmp1 <at> base2.cc> wrote:
> The following jython script fails on trunk with a OutOfMemoryError
> exception, but works with jython 2.2.1.  If trunk is run with -Xmx128M then
> it works.. but this seems excessive for the given script.
>
> import xml.dom.pulldom
>
> xmlf = file("tmp.xml", "w")
> xmlf.write("<foo>\n")
> for i in range(1, 8000):
>    xmlf.write("  <data>%s</data>\n" % i)
> xmlf.write("</foo>\n")
> xmlf.close()
>
> xmldoc = xml.dom.pulldom.parse("tmp.xml")
> event, dbnode = xmldoc.getEvent()

I think that pulldom is definetely broken on trunk. This doesn't work for me:

>>> from xml.dom.pulldom import parseString
>>> parseString("<foo></foo>")

I even filled a bug [1] for this problem

Does it work for you?

[1] http://bugs.jython.org/issue1047
--

-- 
Leo Soto M.
http://blog.leosoto.com

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

Gmane