Re: CLR Memory Footprint
From: Ian Griffiths [C# MVP] (ian-interact-sw_at_nospam.nospam)
Date: 12/01/04
- Previous message: Richard Blewett [DevelopMentor]: "Re: Sandboxed appdomain opening winforms"
- In reply to: Eric Smith: "CLR Memory Footprint"
- Next in thread: Claudio Caldato [MSFT]: "RE: CLR Memory Footprint"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 1 Dec 2004 09:31:59 -0000
The memory footprint can be a big issue with the CLR. You're looking at a
minimum of 4.5MB per process in my experience, and that's for very simple
use of the CLR. It tends to be a lot more if you use any of the substantial
areas of the framework class libraries.
If your code is going to run in lots of processes, you can mitigate some of
the hit with NGEN. This tool, which is part of .NET, precompiles your
component rather than relying on JIT compilation. (NGEN is short for Native
code GENeration.) This enables the compiled binaries to be shared between
processes in the usual way that Windows binaries work. (This sharing
doesn't occur today if you use the normal JIT compilation.)
However, that just mitigates the code-related working set hit. I'm not
really sure what proportion of the typical memory costs of using the .NET
framework are down to code and how much is down to other use of memory.
(And the only way to be sure would be to try out a few scenarios and measure
them)
-- Ian Griffiths - http://www.interact-sw.co.uk/iangblog/ DevelopMentor - http://www.develop.com/ "Eric Smith" wrote: > I'm working on a project that integrates with Office and the Windows > shell. Right now we have add-ins for Excel, PowerPoint, Word and Outlook, > and a couple of shell extensions for Windows Explorer, all written in C++. > > We're at a point where we want to overhaul some of this stuff, so we're > considering whether to use C# instead of C++. There are lots of huge > advantages to C#, but we're concerned about the memory footprint of the > CLR. > > As I understand it, we'd have a separate CLR for each process, meaning > someone using multiple Office applications simultaneously could be hit > pretty hard memory-wise with all those managed add-ins. > > Is this an accurate view? Is there anything we can do to alleviate the > problem? > >
- Previous message: Richard Blewett [DevelopMentor]: "Re: Sandboxed appdomain opening winforms"
- In reply to: Eric Smith: "CLR Memory Footprint"
- Next in thread: Claudio Caldato [MSFT]: "RE: CLR Memory Footprint"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|