![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Could you clarify the contents of the object (what makes it hundreds of K)? And how are you measuring the memory overhead in each case? Thanks! "Michael Cline" wrote: Framework 1.1 Our environment requires us to deserialize xml messages into objects. In doing some memory analysis I've found the following that doesn't make any sense to me so I was hoping someone could shed some light on the issue. Simple Object contains a string, int and bool, as well as another complex object that also contains a string, int and bool. If I use code to loop through and create identical objects and add them to a Hashtable, I see each object taking 430K If I put a method within that object that 'clones' it and returns a new object, the new object is only 234K. Changing the scenario to using the XmlSerializer to deserialize the object from a string, my memory size of a single object grows to 1016K. If I call my 'clone' method on this object the size is reduced to 488K. In my simple mind all of these instances are identical, however there are 4 different sizes which cover a large range. I'm thinking of creating a CodeGeneration application that could create my 'clone' methods for me, but wanted to make sure that what I was seeing had some logical justification behind it. Also, does this behavior change in .NET 2.0 or 3.0? Is there any way for me to get my 'deserialized' version of the object to be down to the 234K size? Thanks |
#6
| |||
| |||
|
|
Could you clarify the contents of the object (what makes it hundreds of K)? And how are you measuring the memory overhead in each case? Thanks! "Michael Cline" wrote: Framework 1.1 Our environment requires us to deserialize xml messages into objects. In doing some memory analysis I've found the following that doesn't make any sense to me so I was hoping someone could shed some light on the issue. Simple Object contains a string, int and bool, as well as another complex object that also contains a string, int and bool. If I use code to loop through and create identical objects and add them to a Hashtable, I see each object taking 430K If I put a method within that object that 'clones' it and returns a new object, the new object is only 234K. Changing the scenario to using the XmlSerializer to deserialize the object from a string, my memory size of a single object grows to 1016K. If I call my 'clone' method on this object the size is reduced to 488K. In my simple mind all of these instances are identical, however there are 4 different sizes which cover a large range. I'm thinking of creating a CodeGeneration application that could create my 'clone' methods for me, but wanted to make sure that what I was seeing had some logical justification behind it. Also, does this behavior change in .NET 2.0 or 3.0? Is there any way for me to get my 'deserialized' version of the object to be down to the 234K size? Thanks |
#7
| |||
| |||
|
|
Could you clarify the contents of the object (what makes it hundreds of K)? And how are you measuring the memory overhead in each case? Thanks! "Michael Cline" wrote: Framework 1.1 Our environment requires us to deserialize xml messages into objects. In doing some memory analysis I've found the following that doesn't make any sense to me so I was hoping someone could shed some light on the issue. Simple Object contains a string, int and bool, as well as another complex object that also contains a string, int and bool. If I use code to loop through and create identical objects and add them to a Hashtable, I see each object taking 430K If I put a method within that object that 'clones' it and returns a new object, the new object is only 234K. Changing the scenario to using the XmlSerializer to deserialize the object from a string, my memory size of a single object grows to 1016K. If I call my 'clone' method on this object the size is reduced to 488K. In my simple mind all of these instances are identical, however there are 4 different sizes which cover a large range. I'm thinking of creating a CodeGeneration application that could create my 'clone' methods for me, but wanted to make sure that what I was seeing had some logical justification behind it. Also, does this behavior change in .NET 2.0 or 3.0? Is there any way for me to get my 'deserialized' version of the object to be down to the 234K size? Thanks |
#8
| |||
| |||
|
#9
| |||
| |||
|
#10
| |||
| |||
|
|
Framework 1.1 Our environment requires us to deserialize xml messages into objects. In doing some memory analysis I've found the following that doesn't make any sense to me so I was hoping someone could shed some light on the issue. Simple Object contains a string, int and bool, as well as another complex object that also contains a string, int and bool. If I use code to loop through and create identical objects and add them to a Hashtable, I see each object taking 430K If I put a method within that object that 'clones' it and returns a new object, the new object is only 234K. Changing the scenario to using the XmlSerializer to deserialize the object from a string, my memory size of a single object grows to 1016K. If I call my 'clone' method on this object the size is reduced to 488K. In my simple mind all of these instances are identical, however there are 4 different sizes which cover a large range. I'm thinking of creating a CodeGeneration application that could create my 'clone' methods for me, but wanted to make sure that what I was seeing had some logical justification behind it. Also, does this behavior change in .NET 2.0 or 3.0? Is there any way for me to get my 'deserialized' version of the object to be down to the 234K size? Thanks |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |