Like GuyFawkes , I would like to use a MemoryStream to store a lot of data, but I continue to run into memory exceptions.
TomTom's answer is what I would like to do - use an implementation that does not require a continuous block - but I wonder if there is already a free implementation so that I can write it myself?
Does anyone know of a good, free reimplementation of MemoryStream that can handle large threads?
EDIT:
The MemoryMappedFile solution is very interesting, and I will remember it for other projects, however, as Henk says, it is too far from the abstraction that MemoryStream aims for. In particular, the requirement of known capacity.
The data that the replacement should handle will in some cases be very large, but in others relatively small (and we do not know what will be until it is too late;)); in addition, many instances of the class will exist simultaneously. Ultimately, the work required to use MemoryMappedFiles (to determine the appropriate size for each of them) will be equivalent to the work associated with implementing the TomTom solution.
sebf
source share