rmuir commented on issue #11754:
URL: https://github.com/apache/lucene/issues/11754#issuecomment-2327418150

   @javanna if you can reproduce it again, can you try 
`System.out.println(mulFactor)` at the end of the BeforeClass method?
   
   OOM in the stacktrace comes from creating priorityqueue of `1000 * 
mulFactor`. Then if we look at `@BeforeClass` where the `mulFactor` gets set, 
it isn't even constant, it is set dynamically, with exponential (!) growth like 
this:
   
   ```java
       do {
         addIndexes();
         ...
         mulFactor *= 2;
       } while (docCount < 3000 * NUM_FILLER_DOCS);
   ```
   
   I think the fact it grows index and pq size (mulFactor) exponentially, may 
be the reason for the trouble. half of the time (NUM_FILLER_DOCS=4k) it creates 
12M document index. 
   
   in some rare situations (PRE_FILLER_DOCS small or zero) it looks like it may 
need to addIndexes() 12 times to do this and so I think `mulFactor` can get 
high such as `4K`? And I think that leads to asking for millions of results at 
once (1000 * 4096) and causes the OOM.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to