Elasticsearch-net: RecyclableMemoryStreamManager does not ever release the allocated memory

Created on 21 Oct 2019  路  3Comments  路  Source: elastic/elasticsearch-net

NEST/Elasticsearch.Net version: 7.3.1
RecyclableMemoryStreamManager allocates small memory blocks by request, but the logic of freeing up the allocated memory is never invoked.
MaximumFreeSmallPoolBytes is not set anywhere and has a default value of zero, so the blocks are always returned back to the pool:
https://github.com/elastic/elasticsearch-net/blob/2638c1e9963680abd566b5b599cfb9f5e1045d0f/src/Elasticsearch.Net/Providers/RecyclableMemoryStreamManager.cs#L330
This leads to the growing large objects heap under load.

Research

Most helpful comment

There is any chance of these fixes get into v6.x? It's happening on release 6.8.1, too :(

All 3 comments

Thank you for raising this we will do another dive into the pool characteristics especially for longer running processes

related: https://github.com/microsoft/Microsoft.IO.RecyclableMemoryStream/issues/75

Opened to https://github.com/elastic/elasticsearch-net/pull/4172 to be able to visualize the characteristics of the memory pool.

Closing this to keep the discussion isolated on the PR. Please don't hesitate to comment there 馃憤

There is any chance of these fixes get into v6.x? It's happening on release 6.8.1, too :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ejsmith picture ejsmith  路  3Comments

mszczepaniakebsco picture mszczepaniakebsco  路  5Comments

maxsel picture maxsel  路  5Comments

mausch picture mausch  路  4Comments

russcam picture russcam  路  3Comments