What means exactly "Memory error"?

Bo M. Maryniuck b.maryniuk at forbis.lt
Thu Apr 24 08:06:20 EDT 2003


Hello, all.

I made an application which uses 4DOM. I have a big (~10M) autogenerated HTML 
file from an Oracle tool. The problem is to public it. Nobody want to open 
10MB HTML file in their browser. 

OK, so the main idea was to split it using frequently repeated <HR> tag. Then 
I got ~1500 parts. OK, now I parse each part with HtmlLib and keep it tree 
somewhere in the variable (in memory). Then after each part is parsed I want 
to do a lot of changes inside the document to adapt it to using with Zope in 
the cycle.

Using this idea with the files up to 2-3M -- no problem. But when I took 
biggest one, it crashes with strange weird stuff I can't exaplain. Somebody 
knows what "Memory error" might appear and how to avoid (if possible) it?

Used software:
	Python 2.2
	4Suite (from the CVS) 
	latest PyXML. 
	OS Linux SuSE 7.1 Pro with it originally compiled kernel 2.4.0-64GB-SMP

Hardware:
	Four CPU machine: Pentium III (Cascades) 700Mhz
	RAM (size): 4GB
	A lot of free space on hard disks...

Full traceback is here:
-----------------------8<-------------------------------------
Traceback (most recent call last):
  File "./mono2chunk.py", line 244, in ?
    mc.processDocument()
  File "./mono2chunk.py", line 138, in processDocument
    self.__doc_complete[_ref] = 
self._evaluateChunk(self.__parseHtmlDoc(partData), _ref)
  File "./mono2chunk.py", line 67, in __parseHtmlDoc
    doc = HtmlLib.FromHtml(''.join([Mono2Chunks.__html_header_,
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/HtmlLib.py", 
line 89, in FromHtml
    return Reader().fromString(text, ownerDoc, charset)
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/HtmlLib.py", 
line 70, in fromString
    return self.fromStream(stream, ownerDoc, charset)
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/HtmlLib.py", 
line 28, in fromStream
    self.parser.parse(stream)
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/Sgmlop.py", 
line 57, in parse
    self._parser.parse(stream.read())
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/Sgmlop.py", 
line 166, in finish_starttag
    parent.appendChild(element)
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/FtNode.py", line 256, in 
appendChild
    newChild._4dom_fireMutationEvent('DOMNodeInserted',relatedNode=self)
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/FtNode.py", line 378, in 
_4dom_fireMutationEvent
    relatedNode,prevValue,newValue,attrName)
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/Event.py", line 120, in 
initMutationEvent
    Event.initEvent(self,eventTypeArg, canBubbleArg, cancelableArg)
  File "/usr/lib/python2.2/site-packages/_xmlplus/dom/Event.py", line 93, in 
initEvent
    self.bubbles = canBubbleArg
MemoryError
-----------------------8<-------------------------------------

-- 
Regards, Bogdan

A witty saying proves nothing.
                -- Voltaire






More information about the Python-list mailing list