I'm using serialization for "save" feature in my application. But when the data is too big (15+ MB) I'm starting to get OutOfMemory exceptions.
I've got so many objects and they are connected with other little objects, I think this is causing too much processing power and data held in the memory.
My code is based on this, almost same:
http://www.codeproject.com/KB/vb/TreeViewDataAccess.aspx
Edit :
I don't use custom serialization, it's all done by [Serialization] attributes. Excluding some fields.
I serialize so many objects and custom classes. Includes Dictionary, structures and bunch of other stuff.
I serialize it into a file.
I use XmlSerializer
P.S. I've got 4 GB physical memory.
Solution
Thanks to answers, my problem was found to be with XmlSerializer and I've got rid of it. Binary serialization is working just fine with the data I've got.