SV: [jdom-interest] Memory problem

Marcus Andersson marcus.andersson at active-tv.com
Thu Oct 17 11:53:08 PDT 2002


I have perhaps not used the most scientific way. I comment out the code that
builds the document and checks how big the program becomes. Then I uncomment
the lines that builds the document and then checks the size again. I then
take the second value and subtract with the first value. Very simple. The
"program" is a RMI object and the only thing that happens before the
document parsing is that I bind the RMI object to the registry. The program
takes about 40Mb without the document and about 150Mb with the document
(which tells me that I have to revise what I said earlier, the document is
"only" about 110Mb big in memory).

/Marcus

-----Ursprungligt meddelande-----
Från: Elliotte Rusty Harold
Till: Marcus Andersson; jdom-interest at jdom.org
Skickat: 2002-10-17 18:51
Ämne: Re: [jdom-interest] Memory problem

At 6:34 PM +0200 10/17/02, Marcus Andersson wrote:
Hello everyone,

I have a problem regarding memory when using JDOM. Before I say 
anything else I just want to say I have seen that there are some 
issues in the archive regarding my problem.

Anyway, the problem is that a 1Mb big XML file becomes about 140Mb in 
memory when I have used SAXBuilder to build the JDOM document. I have 
seen in previous mails that there may be a factor 10 when building to 
a JDOM document. Now it is a factor 140. That cannot be correct. I 
must have done something wrong. It did cause me OutOfMemoryError in 
the beginning but I found -Xmx128m flag in some previous mail on this 
topic.


How do you measure the memory used by the document?
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20021017/4db1d148/attachment.htm


More information about the jdom-interest mailing list