Any size limitation on the BinaryFormatter serialization

  • Thread starter Thread starter Dominic
  • Start date Start date
D

Dominic

Hi everybody,

In my application, I'm planning to use BinaryFormatter to serialize a
potentially huge object to file (and, of course, deserialize back to
memory later). My question is if there is any hard limit on the size
of this object?

Is it only limited by the amount of memory or hard-disk space in the
server?

If there is no limit, how scalable is this serialization process?

Thanks in advance for any input to this subject
Dominic
 
BinaryFormatter can take a memory stream or any type of stream. So you can
serialize
directly to disk. When you deserialize, you'll need enough memory to recreate
the object
tree that you originally serialized. Currently there isn't really any way to
figure out how much
memory your object is going to take without using the ICorProfiler interfaces.

BinaryFormatter is extremely fast. It is used for remoting and many other time
critical applications
so it will continuously be improved on for performance. However, it isn't
extremely robust. A single
touch to the file on disk can cause it to be unreadable. You can see more about
this tamper issue on
my blog: http://weblogs.asp.net/justin_rogers/archive/2004/02/02/66508.aspx
 
Back
Top