問題文
A flow reads files that are usually 3 megabytes but occasionally 400 megabytes, and the payload is read twice in the flow. The team must avoid running out of heap. Which streaming arrangement fits?
選択肢
- Switch to the non-repeatable strategy, because it holds no copy of the stream and passes the content straight through to the component that reads it.
- Switch to the repeatable in-memory strategy, because it holds the whole stream in memory and grows the buffer in fixed steps until the whole content fits inside it.
- Keep the repeatable file-store strategy, because it holds the first part of the stream in memory and writes the rest to disk when the content grows past that.
- Keep the repeatable file-store strategy, but raise the in-memory part to the size of the largest file so that the content never has to go to the disk.