473,789 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any size limitation on the BinaryFormatter serialization

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
Jul 21 '05 #1
2 3808
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.../02/66508.aspx
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
"Dominic" <do****@hotmail .com> wrote in message
news:2b******** *************** ***@posting.goo gle.com...
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

Jul 21 '05 #2
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.../02/66508.aspx
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
"Dominic" <do****@hotmail .com> wrote in message
news:2b******** *************** ***@posting.goo gle.com...
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

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3834
by: aladdinm1 | last post by:
Hi All, I have an annoying trouble with binary serialization. I have a windows forms application which works like a server and keeps sending data to its clients. The data is serialized before being sent using BinaryFormatter and a serializable object. When using a windows forms application as a client, everything works just fine and deserialized data can be received intact. When the client application is is embedded in Internet Explorer (I...
1
8006
by: Jón Sveinsson | last post by:
Hello everyone I have been trying to read and write struct to binary files, I'm using to functions to convert the struct to bytes and bytes to struct, I always receive the following error C:\Documents and Settings\jon.JONHS-LAP\My Documents\Visual Studio
1
3389
by: Dominic | last post by:
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?
6
41076
by: cameron | last post by:
I need to get the size of an objet in memory. I have tried: System.IO.MemoryStream m = new System.IO.MemoryStream(); System.Runtime.Serialization.Formatters.Binary.BinaryFormatter b = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); b.Serialize(m, Obj); double size = Convert.ToDouble(m.Length); but not everything is serializable. The thing is I want to be able to
3
5482
by: Joshua Moore | last post by:
I have a webservice that serializes a ton of variables and other good stuff to a txt file using SoapFormatter (IFormatter), and when I try to deserialize it using the binary formatter, i get the following error: BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version 1986938170.1886350437. I've read a lot about this error from several sources on the net, but can't
11
3959
by: Igor | last post by:
Hi. While executing BinaryFormatter.Deserialize() I get: System.InvalidCastException: Specified cast is not valid. I implemented ISerializable interface. What may be a problem? Thanks.
0
2078
by: Fruber Malcome | last post by:
I'm getting a very weird exception and hoping someone may be able to help. I have an Office Add-In that lives in a .dll (for email reference ai.dll) ai.dll makes calls into the core part of the application implementation in another .dll (let's call that app.dll). app.dll makes a function call into another dll (let's call that one dep.dll). dep.dll has some code in it where it deserializes a memorystream using a binaryformatter.
2
5820
by: Doug Lind | last post by:
Hi all, I have seen a number of posts re: the BinaryFormatter version incompatibility but nothing on how to recover from it. In my case, I want the exception to trigger an alternate behaviour and continue process the stream. My app reads and writes configuration settings to a binary file upon starting and shutdown. The settings are stored in various objects that are serialized and deserialized using a BinaryFormatter. When reading...
1
2289
by: Tarscher | last post by:
Hi all, i want to save my application to a file with a BinaryFormatter . I have some questions how the BinaryFormatter will work when the I update my application. How can I make sure that I can still read older saved files. I looked for a tutorial but can't seem to find one. Someone has experience with BinaryFormatter and versioning?
0
9506
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10403
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10193
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9978
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9015
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5414
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5546
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2904
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.