<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>SV: [jdom-interest] Memory problem</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>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 &quot;program&quot; 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 &quot;only&quot; about 110Mb big in memory).</FONT></P>

<P><FONT SIZE=2>/Marcus</FONT>
</P>

<P><FONT SIZE=2>-----Ursprungligt meddelande-----</FONT>
<BR><FONT SIZE=2>Från: Elliotte Rusty Harold</FONT>
<BR><FONT SIZE=2>Till: Marcus Andersson; jdom-interest@jdom.org</FONT>
<BR><FONT SIZE=2>Skickat: 2002-10-17 18:51</FONT>
<BR><FONT SIZE=2>Ämne: Re: [jdom-interest] Memory problem</FONT>
</P>

<P><FONT SIZE=2>At 6:34 PM +0200 10/17/02, Marcus Andersson wrote:</FONT>
<BR><FONT SIZE=2>Hello everyone,</FONT>
</P>

<P><FONT SIZE=2>I have a problem regarding memory when using JDOM. Before I say </FONT>
<BR><FONT SIZE=2>anything else I just want to say I have seen that there are some </FONT>
<BR><FONT SIZE=2>issues in the archive regarding my problem.</FONT>
</P>

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

<P><FONT SIZE=2>How do you measure the memory used by the document?</FONT>
<BR><FONT SIZE=2>-- </FONT>
</P>

<P><FONT SIZE=2>+-----------------------+------------------------+-------------------+</FONT>
<BR><FONT SIZE=2>| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |</FONT>
<BR><FONT SIZE=2>+-----------------------+------------------------+-------------------+</FONT>
<BR><FONT SIZE=2>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XML in a&nbsp; Nutshell, 2nd Edition (O'Reilly, 2002)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=2>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.cafeconleche.org/books/xian2/" TARGET="_blank">http://www.cafeconleche.org/books/xian2/</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=2>|&nbsp; <A HREF="http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/" TARGET="_blank">http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/</A>&nbsp; |</FONT>
<BR><FONT SIZE=2>+----------------------------------+---------------------------------+</FONT>
<BR><FONT SIZE=2>|&nbsp; Read Cafe au Lait for Java News:&nbsp; <A HREF="http://www.cafeaulait.org/" TARGET="_blank">http://www.cafeaulait.org/</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=2>|&nbsp; Read Cafe con Leche for XML News: <A HREF="http://www.cafeconleche.org/" TARGET="_blank">http://www.cafeconleche.org/</A>&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=2>+----------------------------------+---------------------------------+</FONT>
</P>

</BODY>
</HTML>