[ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12415825 ]
Doron Cohen commented on LUCENE-504: ------------------------------------ Yes this is correct - e.g. on a win32 machine with 2GB RAM, SUN 1.5 JRE would accept up to Xmx1470m and in that case you could set the limit on the queue size to 355,638,512 - 17% of maxint, before getting an out of mem error. For allowing the caller maximal flexibility (and responsibility), BooleanQuery could interpret the maxint as a hint saying "maximal possible value" and then silently modify it to maxint-1, thereby avoiding the negative array size issue in PriorityQueue (and possibly fail later with out of memory). Is this what you have in mind? > FuzzyQuery produces a "java.lang.NegativeArraySizeException" in > PriorityQueue.initialize if I use Integer.MAX_VALUE as > BooleanQuery.MaxClauseCount > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: LUCENE-504 > URL: http://issues.apache.org/jira/browse/LUCENE-504 > Project: Lucene - Java > Type: Bug > Components: Search > Versions: 1.9 > Reporter: Joerg Henss > Priority: Minor > Attachments: BooleanQuery.java.diff, PriorityQueue.java.diff, > TestFuzzyQueryError.java > > PriorityQueue creates an "java.lang.NegativeArraySizeException" when > initialized with Integer.MAX_VALUE, because Integer overflows. I think this > could be a general problem with PriorityQueue. The Error occured when I set > BooleanQuery.MaxClauseCount to Integer.MAX_VALUE and user a FuzzyQuery for > searching. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]