Re: Best practice using large objects in foreach



No; C is /vastly/ more efficient overall, as the memory footprint is
minimised during processing due to early disposal. In A & B this is
performed by the GC, so you will see (for a large set) the memory usage
ramp for a while, then processing grind to a halt as the GC tears down
the improperly discarded images, and then the memory start ramping up
again. I would anticipate C to stay fairly constant both in terms of
memory footprint and processing rate, and it will put much less stress
on the rest of the system - important in a server environment.

Marc

.