-
Notifications
You must be signed in to change notification settings - Fork 745
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
plumbing: format/packfile, prevent large objects from being read into memory completely #303
Conversation
This PR adds code to prevent large objects from being read into memory from packfiles or the filesystem. Objects greater than 1Mb are now no longer directly stored in the cache or read completely into memory. Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath Thanks for the PR. I like the changes but I'm a little worried of using a goroutine for the reader. Do you think it can be done without using it? |
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
So before you merge this, there are a couple of questions that we should think about:
Many thanks for your work on this |
Sorry I've taken so long to answer my own questions here.
This is fine - it's only when you get the reader that you actually do the reading.
This is also probably fine. |
Unfortunately the code in go-git#303 was incorrect for large objects in OFS deltas. The underlying fault is that the seeker in the packfile was seeking away whilst the delta was being read. This PR simply reads the delta into a buffer. Fix go-git#323 Signed-off-by: Andrew Thornton <art27@cantab.net>
… memory completely (go-git#303) This PR adds code to prevent large objects from being read into memory from packfiles or the filesystem. Objects greater than 1Mb are now no longer directly stored in the cache or read completely into memory. Signed-off-by: Andrew Thornton <art27@cantab.net>
…ead into memory completely (go-git#303)" (go-git#329) This reverts commit 385240e.
This PR adds code to prevent large objects from being read into memory from packfiles or the filesystem.
Objects greater than 1Mb are now no longer directly stored in the cache
or read completely into memory.
Signed-off-by: Andrew Thornton art27@cantab.net