The generated DOM tree is in ram and this can get pretty huge with big
documents.
Do you get the out of memory when you have all 5 pages filled or does it
take
some time before you get the exception ?
There is no need to call System.gc(), but do try to increase memory as
suggested and see if that helps.
Mikael
----- Original Message -----
From: "Tonny Kohar" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, February 14, 2008 6:18 AM
Subject: Re: Outofmemory using Batik libs
Hi,
On Feb 14, 2008 10:25 AM, Henrique de Miranda Gontijo
<[EMAIL PROTECTED]> wrote:
I need some help with the problem of out of memory with at jsvgcanvas. At
my
viewer, I have a ArrayList() where I put my JSVGCanvas objects. The size
of
the ArrayList is the total of pages the document have.
I want to keep five pages in memory. So every time I change this cache, I
do
this:
/* This for can found the correct pages in memory */
for (int i = currentRange.getStartPage(); i < currentRange.getEndPage() +
1;
i++) {
FVCanvas canvas = (FVCanvas) iterator.getItemAtPosition(i);
canvas.stopProcessing();
canvas.setDocument(null);
canvas.dispose();
}
I also call System.gc() every time I change the page.
Does anybody have any idea why some memory still in use?
I do not know about why some memory still in use. But you can increase
the memory of your java application by adding -Xmx???m eg: -Xmx256m.
I think the amount of memory used by Batik is less influenced by
number of pages, but more toward how big and how many element, how
complex element is the page (the bigger/complex the more memory used,
although it is only 1 page)
I think batik memory can be divided into:
- DOM object
- Renderer result (this is image file)
- Renderer cache result (this is image file)
- other things.
it is all added together. Just the renderer result already quite big
if you have big image resolution (basic calc eg: 1024*768*4(RGBA) +
other things)
I think Batik maintainer will know better how batik use memory.
Cheers
Tonny Kohar
--
Sketsa SVG Editor
imagine, design, create ...
http://www.kiyut.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]