By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,877 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,877 IT Pros & Developers. It's quick & easy.

Working with very large byte array's

P: n/a

We are currently working on a serialization task which imports data
into memory streams. At first, we had problems with a very high amount
of data as the memory management of such memory streams is always
multiplying the required memory buffer size by two. We are now
"guessing" the required amount and are setting the capacity properly.

The next Problem (which is the one I'am talking about) is the
ToArray() method of that memory stream (which _length reads as
380615112 and the _capacity returns 465616520 (our guessed value)). We
need to return byte[] but the ToArray method does simply cause an
OutOfMemory Exception. I understand that we reached a point where it's
no longer possible to reserve such a huge amount of memory as one
single block but as the VM size is large enough, is there any similar
data structure wich acts like byte[] but reserves it's memory in small

Thanks for any advice!
Best regards,
Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.