You are projecting based on faulty assumptions.
1) If Windows really needs the memory it will grab it.
2) There would only be one instance of the CLR in memory for all users.
3) As I said, Task Manager is not a reliable indicator of the true scope of
the problem, because it does not reflect memory released by applications,
only memory that's both released and reclaimed by Windows memory management.
Put another way, just because in your particular configuration 40MB is in
use, it does not follow that you can multiply that times any number of users
to arrive at the amount of memory that would be used by that many users.
It's not a linear situation. It's much more complicated than that.
The only way to be sure is to run the app under Terminal Services and log on
with 10 users and see what actually happens. My suspicion is that the
actual usage will be something like 25M per user until Windows feels
claustrophobic, at which point it will reclaim the memory that the app has
released, and you'll end up with something more like 15M plus a small amount
per user actually consumed.
--Bob
[quoted text, click to view] "Haim" <haim_lz@hot.com> wrote in message
news:05f501c4ebe9$eb5b8f10$a501280a@phx.gbl...
>
> This application is tested to run on terminal servers and
> as such this memory usage is unacceptable, one of the
> main concerns when using a terminal server is how much
> memory each application consumes. Imagine 20 users, each
> using this application - that would mean almost Giga of
> memory usage on the server for this application alone!
> 40MB of memory is just too much.
> I understand that for each dll I'm using in my project
> the run time loads the same namespaces
> (System.windows.forms for example) again and again. is
> there a way to share and load each namespace only once?
>
> Thanks again
>
> Haim.
>
>>-----Original Message-----
>>Haim,
>>
>>You are doing nothing wrong and there is nothing to be
> concerned about.
>>
>>The common language runtime loads for the first
> executing .NET application,
>>and takes a certain amount of memory (the same as all
> other runtimes). In
>>addition, Windows does not reclaim all released memory
> until it actually
>>needs it for something, so memory consumption reported
> by Task Manager is
>>not a reliable indication of problems. In fact if you
> minimize your running
>>Winforms application you'll usually see memory "usage"
> drop because that is
>>one of the times when Windows does its memory
> housekeeping.
>>
>>--Bob
>>
>>"Haim" <haim_lz@hot.com> wrote in message
>>news:2a1a01c4eb53$fc95dfb0$a401280a@phx.gbl...
>>> Hello all,
>>> I am writing an application in C#, VB.NET which
> basicaly
>>> has a form with a few pictureBoxes on it and a
> TabControl
>>> with 3 tab pages - in each one a treeView and a
> ListView.
>>> In addition it loads a few other dll's as a reference
>>> which should not be memory consuming since each have a
>>> few simple classes.
>>> The thing is - this application can take up to 40,000KB
>>> of memory!!!
>>> Any idea where to start checking? How can I debug and
> see
>>> what part of my application is responsible for such
>>> memory usage?
>>>
>>> One more thing: I did some tests and noticed that even
> a
>>> simple form with nothing on it can take up to
> 15,000KB ,
>>> am I doing something wrong???
>>>
>>> Thanks,
>>>
>>> Haim.
>>
>>
>>.
>>