Thanks, we're very grateful that you corrected the problem! We didn't
realise that these small images would actually use that much space just
because of their scaling. Good to know. I applied your suggested change
to our CSS and it works like a charm. The document loading time is much
improved also.
Isn't there still a memory leak, then, since it's only after a few
open/save that the JVM freezes? I'm wondering whether the same freeze
could not occur after your correction to our CSS, even if it occurs much
later than before.
Best regards,
Benoit
Hussein Shafie wrote:
> I've reproduced the problem using the files you sent me.
>
> [1] I've set the memory limit to 1024Mb (mem="-Xss1m -Xmx1024m"), just
> in case.
>
> [2] I've opened and closed the document twice. The second time, it
> lasted forever, my Linux box, not XXE, not Java, stopped responding and
> after a while (and a lot of disk trashing), Linux killed XXE!
>
> The diagnostic is simple: *huge* consumption of memory.
>
> * Out of memory problems are not reported when loading images (because
> this occurs so easily and so often in this case).
>
> * Your document contains 13 *small* images *scaled* *up* to
> ~2000x2000pixels ==> The document view needs 13x2000x2000x4 bytes =
> ~198Mb to display your images (1 RGBA pixel = 4 bytes).
>
> * When you close your document and reopen it, for a brief moment you
> have the old document view and the new one both present in memory (XXE
> is not optimized to do better than this) ==> huge consumption of memory.
>
> The cure is very simple (I've tested this: after resetting -Xmx128m, I
> managed to open and close your document 25 times in a row with a steady,
> reasonable, memory consumption).
>
> In the CSS replace:
>
> ---
> content: image(attr("xlink|href"), attr(Width), attr(Height), default,
> icon(no-image));
> ---
>
> by something like:
>
> ---
> content: image(attr("xlink|href"), -400, -400, default, icon(no-image));
> ---
>
> See http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/image.html
>
> Note that 13 ~2000x2000pixels images are totally useless when displayed
> as is on a computer screen (even a top notch computer screen).
>
>
>
> Benoit Maisonny wrote:
>
>> XXE 3.6.0 stops responding after a while and I can reproduce the
>> problem. Actually, maybe it does respond but it's using 100% CPU and
>> takes a _very_ long time to respond.
>>
>> To reproduce the issue, I open and close a certain document (120kB) on
>> the local file system. After a few of times (3 to 5, it's not always the
>> same), the open or close action will take a _very_ long time to
>> complete, or maybe never complete at all: I don't always have the
>> patience to wait. Most of the time, I just kill XXE after a couple of
>> minutes and try again. Sometimes, a simple kill will not be enough or
>> will take too long to register, so I do kill -9.
>>
>> If I don't close the file and just work on it, I don't see this issue
>> (but I don't work long on the same files).
>>
>> I tried this on various JVMs (1.5 and 6; 32 and 64 bits) and 3 different
>> computers, on Linux (I can't remember if I tested this on Windows or
>> not). The command line has "-Xss1m -Xmx512m". I tried larger values
>> without seeing any improvements.
>>
>> Not sure whether memory is an issue, as I don't get any exception, but
>> this document is using a pretty large configuration: 210kB of DTD files,
>> 120kB of CSS, a schematron validation, among other things. No custom
>> Java commands, though.
>>
>> Can you help? Shall I provide more info? A jmap memory dump, maybe?
>>
--
Benoit Maisonny benoit at synclude.com
Director & Consultant http://synclude.com
Synclude