You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Christoph Kiehl (JIRA)" <ji...@apache.org> on 2007/07/30 17:57:53 UTC

[jira] Updated: (JCR-1041) Avoid using BitSets in ChildAxisQuery to minimize memory usage

     [ https://issues.apache.org/jira/browse/JCR-1041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christoph Kiehl updated JCR-1041:
---------------------------------

    Attachment: avoid_using_bitsets.patch

This patch introduces a few new classes for the handling of hits. In essence this patch does two things:

1. It tries to use int arrays instead of BitSet to reduce memory consumption. If a BitSet is more efficient than an int array it switches to using a BitSet instance.
2. The nameTestHits are only created lazily by wrapping the nameTestScorer in a Hits instance.
3. The calculation if the index of a childnode is valid is only done if the corresponding hit is requested.

In our internal tests the query execution performance didn't suffer but is much better for ChildAxisQueries with a large number of matching child nodes.

> Avoid using BitSets in ChildAxisQuery to minimize memory usage
> --------------------------------------------------------------
>
>                 Key: JCR-1041
>                 URL: https://issues.apache.org/jira/browse/JCR-1041
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: query
>    Affects Versions: 1.3
>            Reporter: Christoph Kiehl
>            Assignee: Christoph Kiehl
>         Attachments: avoid_using_bitsets.patch
>
>
> When doing ChildAxisQueries on large indexes the internal BitSet instance (hits) may consume a lot of memory because the BitSet is always as large as IndexReader.maxDoc(). In our case we had a query consisting of 7 ChildAxisQueries which combined to a total of 14MB. Since we have multiple users executing this query simultaneously this caused an out of memory error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.