Re: performance impact of circular references

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc Gravell

    Re: performance impact of circular references

    The only common issue with circular object references is tree-based
    serialization (for example, XmlSerializer and DataContractSer ializer in
    its default mode). Graph-based serializers (BinaryFormatte r,
    DataContractSer ializer with the right options) are fine, though.

    Regular GC etc is fine with circular object references.
  • colin

    #2
    Re: performance impact of circular references

    thanks for the replies, the biggest problem I was having was that the
    some of my objects were being aded to event handlers automatically
    such as directx device and had some helper dictionaries wich were static.
    so my whole tree structure never got collected,
    as I started to open and close a few large trees i soon ran out of memory.
    however i managed to turn the automatic event handler off,
    and make the dictionaries non static.

    took me quite some time to track down the eventhandlers, and find a way to
    turn
    this feature off. although ive probably got to find out what I need to do
    in place of the event handlers but i could at least use weak references
    here,
    as ive used elsewhere to cache the texture objects etc so i can reuse
    existing ones.

    My serialization is all binary format and so each object has to have its own
    routine.

    looks like i might need to investigate an efficient way to make sure
    the GC doesnt leave so much uncollected for so long, although for now
    I just do it manualy to make sure there are no actual memory leaks,
    the taskbar displays the memory used and clicking on it does a colection.

    thanks
    Colin.

    "Marc Gravell" <marc.gravell@g mail.comwrote in message
    news:uD7bh47JJH A.920@TK2MSFTNG P05.phx.gbl...
    The only common issue with circular object references is tree-based
    serialization (for example, XmlSerializer and DataContractSer ializer in
    its default mode). Graph-based serializers (BinaryFormatte r,
    DataContractSer ializer with the right options) are fine, though.
    >
    Regular GC etc is fine with circular object references.

    Comment

    Working...