473,804 Members | 3,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

aspnet_wp.exe + serialization = --resources

hi guys.
I need to clone multiple times an object and I am succesfully cloning using
the regular serialization process, using a MemoryStream. My problem is that
after cloning the object more that 7 or 10 times then my computer's memory
gets flooded by the aspnet working process, and every time I call the
Clone() method the processor
resources gets consumed 100% for like 30 seconds. And this problem increases
as the amount of clones are created increases. I read some other gu had the
same problem but he dindt post the answer.
Please help!

Thanks,
alex.

PS: below is the post from that guy..my problem is exactly the same.
=============== =============== =============== =============== =============== ===
hi there!
I implemented a Clone()-method with BinaryFormatter and MemoryStream as
shown in this Forum-Thread!
everything was fine until now. but suddenly following problem occured:

I clone quite a complex object-structure (composite-pattern, several
collections as members ...).
I need to Clone a node-object several times and add them to the parent-node.

so far, so good - everything works, BUT:
the performance to Clone (serialize & deserialize) becomes VERY slow (> 60
sec) after calling the Clone() about 10 times.
I guess its because of following:
the MemoryStream.Le ngth increases with FACTOR 2 after EVERY Clone()-call, no
matter how big the object was to clone!!!!!
can anybody tell me, for what reason the BinaryFormatter .Serialize()-method
writes doublicated size of datas to the MemoryStream every time I call the
Clone()-method??
is there maybe something wrong with my class-structure which i want to
clone??

thanx for help!
byckler

here my Clone()-implementation:

public virtual object Clone()
{
BinaryFormatter Formatter = new BinaryFormatter (null,
new StreamingContex t(StreamingCont extStates.Clone ));
MemoryStream stream = new MemoryStream();
Formatter.Seria lize(stream,thi s);
stream.Position = 0;
object clonedObj = Formatter.Deser ialize(stream);
stream.Close();
return clonedObj;
}

Mar 17 '06 #1
1 1002
for those interested here is the answer:
http://support.microsoft.com/default...b;en-us;890929
"Alex D." <al********@hot mail.com> wrote in message
news:e$******** ******@TK2MSFTN GP09.phx.gbl...
hi guys.
I need to clone multiple times an object and I am succesfully cloning
using
the regular serialization process, using a MemoryStream. My problem is
that
after cloning the object more that 7 or 10 times then my computer's memory
gets flooded by the aspnet working process, and every time I call the
Clone() method the processor
resources gets consumed 100% for like 30 seconds. And this problem
increases
as the amount of clones are created increases. I read some other gu had
the
same problem but he dindt post the answer.
Please help!

Thanks,
alex.

PS: below is the post from that guy..my problem is exactly the same.
=============== =============== =============== =============== =============== ===
hi there!
I implemented a Clone()-method with BinaryFormatter and MemoryStream as
shown in this Forum-Thread!
everything was fine until now. but suddenly following problem occured:

I clone quite a complex object-structure (composite-pattern, several
collections as members ...).
I need to Clone a node-object several times and add them to the
parent-node.

so far, so good - everything works, BUT:
the performance to Clone (serialize & deserialize) becomes VERY slow (> 60
sec) after calling the Clone() about 10 times.
I guess its because of following:
the MemoryStream.Le ngth increases with FACTOR 2 after EVERY Clone()-call,
no
matter how big the object was to clone!!!!!
can anybody tell me, for what reason the
BinaryFormatter .Serialize()-method
writes doublicated size of datas to the MemoryStream every time I call the
Clone()-method??
is there maybe something wrong with my class-structure which i want to
clone??

thanx for help!
byckler

here my Clone()-implementation:

public virtual object Clone()
{
BinaryFormatter Formatter = new BinaryFormatter (null,
new StreamingContex t(StreamingCont extStates.Clone ));
MemoryStream stream = new MemoryStream();
Formatter.Seria lize(stream,thi s);
stream.Position = 0;
object clonedObj = Formatter.Deser ialize(stream);
stream.Close();
return clonedObj;
}

Mar 17 '06 #2

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

Similar topics

0
1361
by: Andy Searls via .NET 247 | last post by:
Trying to get business objects to work as return values for webservices. The primary problem is that the business objects arelate bound, requiring interfaces for property types. I tryusing the XmlTypeAttribute to indicate the class to use in placeof the interface, but that doesn't seem to do any good. Here's the simplified objects in question: public interface IAddress { int AddressKey {get;set;} }
0
2185
by: Wayne Wengert | last post by:
I have a basic understanding of XML and I have a similar basic grasp of VB.NET for developing Windows applications. I am still struggling with the when/where/how in the proper use of OO classes and such. I currently have a set of XML tables that represent serialized arrays that I need to be able to read into a VB application, deserialize to arrays, modify some values and then re-serialize the arrays.In googling to various resources I...
3
5311
by: scoobydoo | last post by:
Hello, I am trying to implement ICloneable's Clone() function, using Serialization. However, my code causes an exception. I have a class derived from TreeNode called "Node1". In Node1, I have implemented Clone() using serialization. When I call the Clone() function, the following exception is thrown at
6
1590
by: Larry Serflaten | last post by:
Acording to Bob Powell, serializing an object should be a breeze: http://groups.google.com/groups?hl=en&lr=&safe=off&selm=%23TR3qvCcCHA.2544%40tkmsftngp11 But its not happening, and I can't see why not. When I save the file, it does not have near enough data to contain the object, so, no way will I be able to deserialize it. Can anyone see where I went wrong? No errors are reported, but I see no image being saved, or loaded in. ...
2
2634
by: Peter | last post by:
Hi, If I Serialized a instance of class zCMethod and then deserialized it, no error occurs. Now ,I Serialized a instance of class InheritedCMethod and then deserialized it, I got an error. system: MissingMemberException: FieldInfo can't match destination type¡£ I know the error appears only because I have defined a array Geometry(). But I do need the array,how to deal with it?
1
3823
by: Alex D. | last post by:
hi guys. I need to clone multiple times an object and I am succesfully cloning using the regular serialization process, using a MemoryStream. My problem is that after cloning the object more that 7 or 10 times then my computer's memory gets flooded and every time I call the Clone() method the processor resources gets consumed 100% for like 30 seconds. And this problem increases as the amount of clones are created increases. I read some...
2
1859
by: Chukkalove | last post by:
I've had to change a class within an application. The previous developer used serialization to store objects to file. He didnt use ISerializable interface and even if he had..... I just dont trust or like using serialization just for the reasons Im asking for help about. He used binary serialization, and Im getting errors when the file is read from disk as the class has changed. I need to be able to read files created with previous...
2
6633
by: smith4894 | last post by:
{ not sure you're aware of that but there are the newsgroups for all major operating systems. you might want to try asking in the forum 'comp.os.linux.development.apps', since memory-mapped files are not a language-supported structure, they are platform-specific. -mod } I'm trying to use boost serialization to serialize/deserialize data to and from a mmap'd file. I have my own ostream/istream classes that essentially read/write bytes...
0
3673
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and delegates were given CDs containing a pre-release version of the .NET framework/SDK and Visual Studio.NET. · When was the first version of .NET released? The final version of the 1.0 SDK and runtime was made publicly available around 6pm PST on...
0
9589
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
10340
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...
1
10329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
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
9163
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...
1
7626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
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...
1
4304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.