xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hans Stoessel" <hstoes...@pm-medici.ch>
Subject Re: JSVGCanvas: java.lang.OutOfMemoryError
Date Thu, 24 Apr 2003 15:59:05 GMT
Hi

What do you mean with "the BridgeContext to be dynamic"?
What is the BridgeContext?
What or where could tell that the BridgeContext is dynamic?
What I have to looking for?
How can I change that?

Maybe you can give me a tip.

Thanks for your help

Hans


"Thomas E Deweese" <thomas.deweese@kodak.com> schrieb im Newsbeitrag
news:16038.56100.283478.792899@frog.rl.kodak.com...
>
> Hi Hans,
>
>    Warning this is a general Brain Dump (I don't have lots of time
> to poke at this).
>
>    1) I suspect the NPE is being caused by the clip-path elements
>       (This is I think a bug in general for Batik - unfortunately I
>       think a will be a very tricky bug to fix).  I don't think this
>       is the direct cause of your problems (although it may be making
>       it worse).
>
>    2) I think something somewhere is telling the the BridgeContext to
>       be dynamic!  Otherwise the listener that is failing for shape
>       nodes would never get registered at all.
>
>    3) The reason your changes slow the leak down is because you are
>       essentially striping the DOM down to nothing but what is left
>       is still being referenced...
>
>    4) I was wondering if you reused your Dialog objects at all?
>
>    5) I couldn't get Squiggle to run out of memory by creating new
>       viewer frames and loading your document into them (although it
>       did use a _lot_ of memory - I suspect due to the clip-path stuff
>       - see below).
>
>    6) Some content suggestions - your document contained some 3200
>       clip-path usages of just 15 clip paths!  I think you will find
>       your documents load and display much faster if you group objects
>       that are using the same clip path and then put the clip-path
>       specification on the group.
>
>       Also you seem to be using lots of line elements to build the
>       graph.  I would strongly suggest that you build one path element
>       using lots of 'L' commands:
>
>         <line x1="27.093748588225147" x2="27.25791729263496"
y1="107.57115742927745" style="clip-path:url(#clipPath15); fill:none;"
y2="107.57115742927745" />
>         <line x1="27.25791729263496" x2="27.422085997044775"
y1="107.57115742927745" style="clip-path:url(#clipPath15); fill:none;"
y2="107.29939936269608" />
>         <line x1="27.422085997044775" x2="27.58625470145459"
y1="107.29939936269608" style="clip-path:url(#clipPath15); fill:none;"
y2="107.21308615407727" />
>
> becomes:
>
>         <path style="clip-path:url(#clipPath15); fill:none;"
>               d="M27.093748588225147 107.57115742927745
>                  L27.25791729263496  107.57115742927745
>                  L27.422085997044775 107.29939936269608
>                  L27.58625470145459  107.21308615407727"/>
>
> As a side effect your stroke-dash-array specification will then
> actually do something.
>
> >>>>> "HS" == Hans Stoessel <hstoessel@pm-medici.ch> writes:
>
> HS> Hi If I flush the SVG document with the following methods it
> HS> works. But the memory is still increasing, but slower than before:
>
> HS>
//--------------------------------------------------------------------------
> HS> // Flush SVG document
> uit
> HS>
//--------------------------------------------------------------------------
> HS> public void flushSVGDocument() { Node childNode = null;
> HS> SVGDocument oSVGDocument = m_oSVGCanvas.getSVGDocument();
>
> HS>   if (oSVGDocument != null) { SVGSVGElement s =
> HS> oSVGDocument.getRootElement(); removeNodes(s); } System.gc(); }
>
> HS>
//--------------------------------------------------------------------------
> HS> // Flush node
> HS>
//--------------------------------------------------------------------------
> HS> private void removeNodes(Node n) { Node childNode = null; Node
> HS> prevChildNode = null;
>
> HS>   for (childNode = n.getLastChild(); childNode != null;) { if
> HS> (childNode.hasChildNodes()) { removeNodes(childNode); }
> HS> prevChildNode = childNode.getPreviousSibling(); if (!(childNode
> HS> instanceof SVGOMPathElement)) { n.removeChild(childNode); }
> HS> childNode = null; childNode = prevChildNode; } n = null; }
>
> HS> If I try to remove a node which is an instance of SVGOMPathElement
> HS> I have an exception (Null pointer).
>
> HS> Maybe that helps a bit to solve the problem
>
> HS> Hans
>
>
>
>
> HS> ---------------------------------------------------------------------
> HS> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org For
> HS> additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message