I am a new user of batik. What I am trying to do is to 1) use Java to generate a SVG file 2) use JSP to display it with other information. The SVG picture is much simple, just some lines for biological sequence display or heat map (square) for sequence analysis.
First all, do you think this is a good way to use batik and SVG. Secondly, could anyone kindly give me a tutorial link for my starting point?
Thanks alot!
Jin
On 7/30/06,
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi Sudhakar,
Sudhakar S <[EMAIL PROTECTED]> wrote on 07/27/2006 07:44:17 AM:
> I have created the SVGDocument with more than 2000 elements, which
consists
> of rectangles, lines, SVG images and text nodes. It consumes nearly
70000k
> in heap memory for creating all the elements. But when I remove all the
> elements, it consumes double the memory(160154k). Is it possible to
reduce
> the memory usage while removing the elements from the document? I am
using
> the following code to remove elements.
I am not sure why it would use more memory when deleteing elements.
Are you then replacing those elements? I could imagine that the deleted
elements are held until the next refresh of the display.
> Element root = (Element)_document.getDocumentElement().getFirstChild();
> root = (Element)root.getNextSibling().getNextSibling();
This sort of code tends to be problematic in DOM as different
parsers may create slightly different but equivalent node lists
(for example text nodes tend to split differently). You are much better
off giving important nodes an 'id' and finding them with getElementById.
Not that this is your problem though...
> Also when I remove the elements, I am getting the following errors. It
is
> happening only while removing huge number of elements. I think there is
no
> problem in that code. So is there any other think should I take care
while
> removing elements from the document?
>
> 1.
>
> org.w3c.dom.DOMException: <unknown>:
> The attribute "fill" represents an invalid CSS value ("white").
I would guess that this is being caused by a memory overflow
error. Is that possible?
> Original message:
>
org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap(CSSEngine.java:769)
This is a catch from an error in the Parser, so if you get an out of
memory
error in the parse you will get the above message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
