Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Billion Laughs

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Timo Boehme <timo.boehme AT ontochem.com>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Billion Laughs
  • Date: Mon, 05 May 2014 09:31:20 +0200

Am 03.05.2014 11:42, schrieb Elliotte Rusty Harold:
On Sat, May 3, 2014 at 1:53 AM, Dave Pawson <dave.pawson AT gmail.com> wrote:
...

Two more ideas:

1. Should the default limit be based somehow on available memory? and if so
what? e.g. XX% of the heap size?
2. Is it plausible to simply catch an OutOfMemoryError in the Builder and
clean up, or would the system be hosed enough at that point, that cleanup
isn't reliable?

I would vote against catching OutOfMemoryError within a library. You don't know if the error is caused by a malicious document building process or if another part of the application took more memory than expected. In any case only at the application level one might decide to catch that error for a controlled (if this is still possible) shut down/restart.

Providing a configurable memory limit for document building in my opinion is the better way. It can be adjusted on the system capability, the expected document sizes and provides a reproducible error path. The OOME on the other hand might be thrown even on a small XML document while other application routines took too much memory and thus will give a misleading error notification.


Best,
Timo


--

Timo Boehme
OntoChem GmbH
H.-Damerow-Str. 4
06120 Halle/Saale
T: +49 345 4780474
F: +49 345 4780471
timo.boehme AT ontochem.com

_____________________________________________________________________

OntoChem GmbH
Geschäftsführer: Dr. Lutz Weber
Sitz: Halle / Saale
Registergericht: Stendal
Registernummer: HRB 215461
_____________________________________________________________________





Archive powered by MHonArc 2.6.24.

Top of Page