Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-2590

ElasticsearchHSQueryImpl allocates too much memory for query results

    Details

      Description

      This code:

      List<EntityInfo> results = new ArrayList<>( searchResult.getTotal() );
      

      Allocates an array with as many elements as the total number of hits in the index. When using paging, the total number of hits could be one million and the number of results we want to fetch only 10 elements, for instance. So this is bad.

      I checked what I say, by the way: hits.total contains the total number of hits, irrespective of the "size" parameter.

        Attachments

          Activity

            People

            • Assignee:
              yrodiere Yoann Rodière
              Reporter:
              yrodiere Yoann Rodière
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: