lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laimis <>
Subject [GitHub] lucenenet pull request: fix Bits2words logic
Date Sun, 08 Mar 2015 02:12:36 GMT
GitHub user laimis opened a pull request:

    fix Bits2words logic

    TestOpenBitSet.TestSmall test was failing with out of memory exception which you can see
Trying to run it locally with timeout restriction removed resulted in the test process using
4 or more GB of RAM within seconds. After looking into it more, narrowed down what was triggering
the condition: bug in Bits2words logic which would get triggered when numBits parameter was
set to 0.
    To reproduce and observe the results, run TestOpenBitSet.TestSmall test and put a breakpoint
with condition of sz == 0 so that it triggers when random int generation returns 0. You will
see then that OpenBitSet constructor instead of initializing bits array of 0 length will initialize
it to 67108864 and then it is all downhill from there.
    Verified the fix by running Lucene Java tests and made sure the math came out the same
for 0 input, where the result is 0 instead of 67108864.
    Here is Java version: 

You can merge this pull request into a Git repository by running:

    $ git pull openbitset_fix

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #126
commit 8223d5498231cff7034d5034bda8d2e2adfd1205
Author: Laimonas Simutis <>
Date:   2015-03-08T01:59:16Z

    fix Bits2words logic


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message