Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement a fix for #66, excessive memory use in siphon.#67

Open
floren wants to merge 1 commit intopeterbourgon:master from
floren:siphon-buffer-66
Open

Implement a fix for #66, excessive memory use in siphon. #67
floren wants to merge 1 commit intopeterbourgon:master from
floren:siphon-buffer-66

Conversation

@floren
Copy link
Contributor

@floren floren commented Aug 18, 2021

The siphon will now stop writing to its internal buffer once the size of the buffer
exceeds the maximum cache size. Because we write until we exceed the max cache size,
we're safe to attempt the cache update even if the buffer only contains partial data,
because it's still over the limit & will be rejected.

The siphon will now stop writing to its internal buffer once the size of the buffer
exceeds the maximum cache size. Because we write until we *exceed* the max cache size,
we're safe to attempt the cache update even if the buffer only contains partial data,
because it's still over the limit & will be rejected.
Copy link
Owner

Would it be smarter to check both d.CacheSizeMax and fi.Size in readWithRLock, and only create and use the siphon if the file size could conceivably fit in the cache?

Copy link

@peterbourgon can't we combine both approaches ?
the approach in the PR is good as it saves the memory even if the memory metadata is not accurate or writes was done during the read , while your suggestion can save doing the work to begin with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /