[Mono-list] XmlSerializer

Lluis Sanchez lluis@ximian.com
Thu, 20 May 2004 21:45:07 +0200


The MS.NET XmlSerializer should cache the assemblies it generates, but
it seems that in some scenarios it does not. I don't have an answer for
this, the only thing I can say is that in Mono we always cache the
assemblies. You could also try to cache the XmlSerializer instances


On dj, 2004-05-20 at 08:31, Willem.Smit@sanlam.co.za wrote:
> Hi guys
> This mail is not mono related, but it is .Net related. The reason why I'm
> mailing you guys is that you probably know better than any of the Microsoft
> consultants we have here in this place and I'm sure you won't ask me $2000
> just so I could ask you a question.
> We put down a single sign-on solution here at work, using a
> java/websphere/s370 backend and a .Net /c#/COM/ASP frontend. The back-end
> works beautifully, but the appservers that the front-end runs on fall over
> every 4-5 hours depending on load.
> Looking at the performance counters on the box we can see that everytime a
> user logs on using this solution, 7 assemblies gets added to the total
> assemblies and current assemblies counters.  The number of current
> assemblies currently loaded on our box (snapshot) is 151470.
> I've isolated the code that creates these 7 assemblies everytime - it
> happens during a call to the Serialize method of the XmlSerializer.
> Now with a small little test project that serializes a simple class with a
> few string properties, the first time you call Serialize on XmlSerializer 7
> assemblies get created. The difference here is during the next call to
> Serialize no more assemblies are added, it's like XmlSerializer realises
> it's allready built objects to serialize objects of that specific type
> allready, which in my mind seems like the right thing.
> Now my question to you is twofold.
> 1. What is supposed to happen when you call the Serialize method on
> XmlSerializer ?
>       - Do you know of a reason why XmlSerializer would create 7 assemblies
> every time and not reuse the previous objects it built to Serialize ?
> 2. Is this even a problem ? I mean the performance counter says there are
> 151470 assemblies loaded into memory, but there is still more than enough
> memory on the boxes, it's just            that every four hours things
> start going haywire on the servers and single sign-on is the only thing
> that's changed on the boxes. So we're thinking it's because of the reason
>       above, but it might be totally unrelated... I'm really not sure
> I'm in dire straights here guys, and I know this shouldn't bother you
> because it's MS related, but I really would appreciate any help.
> Thanx
> Willem Smit
> ***************
> Any views expressed in this message are those of the individual sender, and
> Sanlam accepts no liability therefore, except where the sender specifically
> states them to be those of Sanlam.
> Enige sienswyses of stellings wat in hierdie boodskap uitgedruk word is diť
> van die individuele afsender, en Sanlam aanvaar geen aanspreeklikheid
> daarvoor nie, behalwe waar die afsender uitdruklik vermeld dat dit diť van
> Sanlam is.
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list