<p>So in a .NET app , i got about 2 million items that i need to hold them in memory for processing , 1 by 1, would holding these items in a Stack collection , is better than holding them in a List collection, assuming that the memory used by the stack object will be keep minimizing every time an item is poped out of the stack object , or the memory allocated by the stack will keep the same till the stack is set to null, or cleared.</p>

<p>sorry if i couldn't express the question in the right way.. but here is another way, when a Stack collection is used, does the memory used by the stack get minimized every time an item is pulled out of the stack.</p>

<p>Thanks in advance</p>

They'll basically be the same for
```
Stack<T>
```
if you definitely want FILO behaviour - because when you remove an element from the end of a
```
List<T>
```
it doesn't need to copy anything.
Now if you were talking about a
```
Queue<T>
```
that would be different - removing from the
head
of a
```
List<T>
```
involves copying the rest of the items, which is inefficient.
The actual memory usage will be the same for either of them - I don't believe either
```
List<T>
```
or
```
Stack<T>
```
automatically "trim to size" when elements are removed.