Plan to have a data structure to store temporary binary data in the memory for analysis.
The max size of the data will be about 10MB.
data will be added at the end 408 bytes at a time.
no search, retrieve operations on those temporary binary data.
data will be wipe out and the storage will be reused for next analysis.
questions:
- which structure is good for this purpose?
byte[10MB], List<bytes>(10MB), List<MyStruct>(24000), or ...? - how to quickly wipe out the data (not List.Clear(), just set the value to 0) for List or array?
- If I say
List.Clear(),the memory for thisListwill shrink or the capacity (memory) of the List is still there and no memory allocation when I callList.AddRange()after theClear()? - List.Insert() will make the List larger or it just replace the existing item?