A furthur note on this:

In JDK1.4 server VM on Win2K, an ArrayIndexOutOfBoundsException causes a memory leak.

Thanks,
Rob

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 2:29 PM
To: [EMAIL PROTECTED]
Subject: Throwing exceptions in non-exceptional circumstances


Hello,

     A colleague at IBM recently sent me private e-mail about exceptions 
that were being thrown in non-exceptional circumstances in 
DeferredDocumentImpl.ensureCapacity().  Last year, after she pointed out 
the cost of testing array capacity in this way, I made some effort to 
submit patches for Xerces-1 to eliminate them where appropriate.  This is 
an instance that was lingering in Xerces-2.

     This patch to DeferredDocumentImpl seems to improve parsing with 
deferred DOM up to a few per cent, depending on the document, JDK, etc.



     I noticed some other ensureCapacity methods in DOMNodePool that have 
the same problem, but they're probably not as important, as the sizes of 
the affected tables are likely to remain relatively stable from one parse 
to the next.  However, one never knows whether someone might use this as a 
model, so I've supplied a patch for it as well.



     There are probably some other instances of this lurking about; I'll 
likely submit some additional patches in the next few days.

     I'd appreciate it if someone could review and commit these patches 
(or comment, if appropriate.)

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      XML Parsers development
IBM SWS Toronto Lab   Tie Line 969-6044;  Phone (905) 413-6044
mailto:[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to