Skip to content

Remove MemoryStreamFactory and replace with RecyclableMemoryStreamFactory #4502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 27, 2020

Conversation

codebrain
Copy link
Contributor

The only usage of MemoryStreamFactory internally is withing tests/documentation.

Removing these uses as its doubtful if use in this situation is worthwhile.

This does remove the MemoryStreamFactory implementation as well, so this is technically a breaking change, so could be made non-breaking by reinstating this class.

@codebrain codebrain requested a review from russcam March 20, 2020 02:39
@Mpdreamz
Copy link
Member

One of its use cases is also to benchmark/profile the recyclable memorystream factory against one that does not pool.

I'm okay reinstating the class existence for folks for whom the memory characteristic of recyclable memory stream come as a surprise. We had tickets in the past where folks suspected a memory leak due to recyclable memorystreams buffers. In some cases it might also be preferable to have GC to be more aggressive (e.g cron tooling)

@codebrain
Copy link
Contributor Author

One of its use cases is also to benchmark/profile the recyclable memorystream factory against one that does not pool.

I'm okay reinstating the class existence for folks for whom the memory characteristic of recyclable memory stream come as a surprise. We had tickets in the past where folks suspected a memory leak due to recyclable memorystreams buffers. In some cases it might also be preferable to have GC to be more aggressive (e.g cron tooling)

I think reinstating is fine, lets just not use it internally.

@codebrain
Copy link
Contributor Author

Closed in favor of: #4509

@codebrain codebrain closed this Mar 25, 2020
@codebrain codebrain reopened this Mar 27, 2020
@codebrain codebrain marked this pull request as ready for review March 27, 2020 02:39
Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The commit message should indicate that usages of MemoryStreamFactory are replaced with RecyclableMemoryStreamFactory (and that MemoryStreamFactory is not removed)

@codebrain codebrain merged commit a6f9790 into 7.x Mar 27, 2020
@codebrain codebrain deleted the research/mem-management branch March 27, 2020 06:57
github-actions bot pushed a commit that referenced this pull request Mar 27, 2020
…4502)

Usages of MemoryStreamFactory are replaced with RecyclableMemoryStreamFactory, MemoryStreamFactory is kept in place for external use.
github-actions bot pushed a commit that referenced this pull request Mar 27, 2020
…4502)

Usages of MemoryStreamFactory are replaced with RecyclableMemoryStreamFactory, MemoryStreamFactory is kept in place for external use.
codebrain added a commit that referenced this pull request Mar 27, 2020
…4502) (#4519)

Usages of MemoryStreamFactory are replaced with RecyclableMemoryStreamFactory, MemoryStreamFactory is kept in place for external use.

Co-authored-by: Stuart Cam <stuart.cam@elastic.co>
codebrain added a commit that referenced this pull request Mar 27, 2020
…4502) (#4520)

Usages of MemoryStreamFactory are replaced with RecyclableMemoryStreamFactory, MemoryStreamFactory is kept in place for external use.

Co-authored-by: Stuart Cam <stuart.cam@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants