https://defect.opensolaris.org/bz/show_bug.cgi?id=18602

--- Comment #24 from Knut Anders Hatlen <[email protected]> 2011-07-01 
19:26:08 UTC ---
Created attachment 4557
  --> https://defect.opensolaris.org/bz/attachment.cgi?id=4557
Reduce memory consumption by adding fields incrementally

Here's an alternative approach. The Lucene experts should take a look to verify
that it's doing the right thing, but I think is.

Personally, I like this approach better because the patch removes more code
than it adds. :)

In short, this patch makes the analyze() methods in JarAnalyzer and
JavaClassAnalyzer add fields incrementally to the Lucene document. This way we
don't need to build up an enormous string for the full text field, so
StringWriter's buffer allocation algorithm becomes less of an issue. (We still
build the full xref for the jar file with StringWriter, though.)

I've tested the patch with a 60MB jar file (rt.jar from JDK 7). Without the
patch, I needed to run with -Xmx900M to avoid the OutOfMemoryError. With the
patch, I successfully indexed the file with -Xmx500M.

-- 
Configure bugmail: https://defect.opensolaris.org/bz/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
opengrok-dev mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opengrok-dev

Reply via email to