GAC Keep objects in memory

  • Thread starter Thread starter patrickbeaudoin
  • Start date Start date
P

patrickbeaudoin

Hi,

I have some application that use the same library in the gac. All these
application use the same xml document. I would like to keep that xml
document loaded in memoy and dont have to reload it all the time.

Same thing for a XslCompileTransform object. It seems to be recompiles
each time I use It... I would like to keep it loaded after it has been
loaded once.

tnx

Patrick
 
Maybe you should consider implementing a service or a serviced
component with pooling and JIT.

Regards,
Tasos
 
Hi Patrick,

If I understand you correctly, you don't need to do anything with the GAC.
It sounds like these class libraries are producing an XML document and
something *from* the XML document using an XSL Transform. So, all you really
need to do is keep these objects (the XML document and the other object) in
memory, rather than re-creating them each time.

If you think of the assemblies in the GAC as a "factory" that produces these
things, you should be able to see that what you don't need is to keep an
instance of the "factory" in memory, but the things that it produces, so it
doesn't have to reproduce them.

In fact, these assemblies *do* remain cached in memory for some time after
you invoke them, by virtue of the .Net platform and Garbage Collection.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.
 
Hi Kevin,

Thanks for the answer.

If I understand your point, you said that I have nothing to do? It's
supposed to stay in memory for a certain periode of time after a call?
Can I change the time of that persistence?

But if it's remain cache, I dont understand why it's faster to use a
XstTransform. If it was still cached in the memory, the
XstCompiledTransform would not have to be faster?

Patrick
 
Back
Top