Why is a .net generic dictionary so big
        Posted  
        
            by thefroatgt
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by thefroatgt
        
        
        
        Published on 2010-04-30T15:56:04Z
        Indexed on 
            2010/04/30
            15:57 UTC
        
        
        Read the original article
        Hit count: 304
        
I am serializing a generic dictionary in VB.net and I am very surprised that it is about 1.3kb with a single item. Am I doing something wrong, or is there something else I should be doing? I have a large number of dictionaries and it is killing me to send them all across the wire. The code I use for serialization is
    Dim dictionary As New Dictionary(Of Integer, Integer)
    Dim stream As New MemoryStream
    Dim bformatter As New BinaryFormatter()
    dictionary.Add(1, 1)
    bformatter.Serialize(stream, dictionary)
    Dim len As Long = stream.Length
© Stack Overflow or respective owner