diskv icon indicating copy to clipboard operation
diskv copied to clipboard

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

Open floren opened this issue 2 years ago • 1 comments

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.

floren avatar Aug 18 '21 20:08 floren

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?

peterbourgon avatar Aug 19 '21 01:08 peterbourgon