473,857 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System resource usage

I'm not quite sure which groups to post this to, so short of a massive
crosspost, I decided on these two.

I am running into troubles with resource usage of our app on Win2k and above
systems. In several places, I have seen it said that the WinNT model only
limits resources to available memory. However, I have seen errors caused by
running out of resources on a machine with over 1GB of free memory (running
Win2k server), as well as on my personal development machine (XP
professional).

On the terminal server machine, the crash appears to happen at exactly
10,000 user objects (as shown by task manager). On my system, it happens at
around 7,000 user objects. In this state, all of windows becomes unstable.
Some windows will not show up, others will disappear. It seems like after
some time, windows will decide to shut down the app hogging all the
resources. This took a very long time on the terminal server machine.

I have written a small test project, all it does is pop up a form with about
a hundred controls on it. Once you pop up about 30 of these forms, you can
see the problem. I can post the code here, if anyone wants it.

So what is the limit with resources? How are we supposed to handle this? At
a client site, when the error comes up, they see the JIT debugger error box.
Any help or references would be greatly appreciated.

Niall
Nov 15 '05 #1
10 2351
Niall,

When you say 10000 user objects, do you mean 10000 simultaneous terminal
server sessions? If you have 10000 simultaneous windows sessions, even with
a few GB of memory, I can see why the machine would become extremely
unstable.

If you are speaking about just 10000 objects (as in a custom object you
wrote in .NET), then I don't see why you would have this problem, and
posting the code would be helpful in determining the cause.

Also, can you be more descriptive about the error that is popping up
when this situation occurs?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Niall" <as**@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I'm not quite sure which groups to post this to, so short of a massive
crosspost, I decided on these two.

I am running into troubles with resource usage of our app on Win2k and above systems. In several places, I have seen it said that the WinNT model only
limits resources to available memory. However, I have seen errors caused by running out of resources on a machine with over 1GB of free memory (running Win2k server), as well as on my personal development machine (XP
professional).

On the terminal server machine, the crash appears to happen at exactly
10,000 user objects (as shown by task manager). On my system, it happens at around 7,000 user objects. In this state, all of windows becomes unstable.
Some windows will not show up, others will disappear. It seems like after
some time, windows will decide to shut down the app hogging all the
resources. This took a very long time on the terminal server machine.

I have written a small test project, all it does is pop up a form with about a hundred controls on it. Once you pop up about 30 of these forms, you can
see the problem. I can post the code here, if anyone wants it.

So what is the limit with resources? How are we supposed to handle this? At a client site, when the error comes up, they see the JIT debugger error box. Any help or references would be greatly appreciated.

Niall

Nov 15 '05 #2
User objects are allocated from the desktop heap which has a system wide
size of 48MB on W2K, this heap consists of three sharedsections, the first
is common to all desktops, the second is per interactive deskto, and the
third is reserved for non interactive desktops.

The values for the three distinct heaps is taken from the registry when the
CSRSS process starts
(see:HKEY_LOCAL _MACHINE\SYSTEM \CurrentControl Set\Control\Ses sion
Manager\SubSyst ems\Windows), what you could do is paly a little bit with the
values found in there taking care that the sum of all heaps must fit into 48
MB!!!

Willy.

"Niall" <as**@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I'm not quite sure which groups to post this to, so short of a massive
crosspost, I decided on these two.

I am running into troubles with resource usage of our app on Win2k and above systems. In several places, I have seen it said that the WinNT model only
limits resources to available memory. However, I have seen errors caused by running out of resources on a machine with over 1GB of free memory (running Win2k server), as well as on my personal development machine (XP
professional).

On the terminal server machine, the crash appears to happen at exactly
10,000 user objects (as shown by task manager). On my system, it happens at around 7,000 user objects. In this state, all of windows becomes unstable.
Some windows will not show up, others will disappear. It seems like after
some time, windows will decide to shut down the app hogging all the
resources. This took a very long time on the terminal server machine.

I have written a small test project, all it does is pop up a form with about a hundred controls on it. Once you pop up about 30 of these forms, you can
see the problem. I can post the code here, if anyone wants it.

So what is the limit with resources? How are we supposed to handle this? At a client site, when the error comes up, they see the JIT debugger error box. Any help or references would be greatly appreciated.

Niall

Nov 15 '05 #3
Nicholas,

Sorry, it appears my post was confusing. I was referring to Windows Resource
User Objects (which you can see in the task manager for a given process),
not objects on the managed heap or terminal server sessions. See Willy's
post for what I mean. This is a similar problem to the old Windows 95 stuff
where the computer became terribly unstable after you ran out of GDI or User
resources. I had read that these resources are "unlimited" in the NT model,
but Willy seems to be more in the know than the places I've been reading.

The test code I have just has a plain form which I just chucked a bunch of
controls onto with the designer. Opening up about 30 instances of that form
on my machine will cause resource problems, new windows won't be able to
show, etc, until I close the app and XP can reclaim all the resources.

Niall

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:uA******** ******@TK2MSFTN GP12.phx.gbl...
Niall,

When you say 10000 user objects, do you mean 10000 simultaneous terminal server sessions? If you have 10000 simultaneous windows sessions, even with a few GB of memory, I can see why the machine would become extremely
unstable.

If you are speaking about just 10000 objects (as in a custom object you wrote in .NET), then I don't see why you would have this problem, and
posting the code would be helpful in determining the cause.

Also, can you be more descriptive about the error that is popping up
when this situation occurs?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Niall" <as**@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I'm not quite sure which groups to post this to, so short of a massive
crosspost, I decided on these two.

I am running into troubles with resource usage of our app on Win2k and

above
systems. In several places, I have seen it said that the WinNT model only limits resources to available memory. However, I have seen errors caused

by
running out of resources on a machine with over 1GB of free memory

(running
Win2k server), as well as on my personal development machine (XP
professional).

On the terminal server machine, the crash appears to happen at exactly
10,000 user objects (as shown by task manager). On my system, it happens

at
around 7,000 user objects. In this state, all of windows becomes unstable. Some windows will not show up, others will disappear. It seems like after some time, windows will decide to shut down the app hogging all the
resources. This took a very long time on the terminal server machine.

I have written a small test project, all it does is pop up a form with

about
a hundred controls on it. Once you pop up about 30 of these forms, you can see the problem. I can post the code here, if anyone wants it.

So what is the limit with resources? How are we supposed to handle this?

At
a client site, when the error comes up, they see the JIT debugger error

box.
Any help or references would be greatly appreciated.

Niall


Nov 15 '05 #4
Willy, thanks very much for your answer. Can I just clarify a couple of
things.

By "system wide", you mean 48MB shared by all users logged in on the
machine?

Is a "desktop" one user session?

Is this 48MB heap the same size on all NT based OS's (NT, XP, 2003, etc), or
do some have different sizes?

The reason why I'm asking is that our client is using Citrix on a Windows
2003 Server machine, with quite a large number of users logged in. I am
wondering whether the more users they have logged in, the less resources
(and hence the less of our app that can be run concurrently) will be
available for any one user. Thanks again,

Niall

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:uN******** ******@tk2msftn gp13.phx.gbl...
User objects are allocated from the desktop heap which has a system wide
size of 48MB on W2K, this heap consists of three sharedsections, the first is common to all desktops, the second is per interactive deskto, and the
third is reserved for non interactive desktops.

The values for the three distinct heaps is taken from the registry when the CSRSS process starts
(see:HKEY_LOCAL _MACHINE\SYSTEM \CurrentControl Set\Control\Ses sion
Manager\SubSyst ems\Windows), what you could do is paly a little bit with the values found in there taking care that the sum of all heaps must fit into 48 MB!!!

Willy.

"Niall" <as**@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I'm not quite sure which groups to post this to, so short of a massive
crosspost, I decided on these two.

I am running into troubles with resource usage of our app on Win2k and

above
systems. In several places, I have seen it said that the WinNT model only limits resources to available memory. However, I have seen errors caused

by
running out of resources on a machine with over 1GB of free memory

(running
Win2k server), as well as on my personal development machine (XP
professional).

On the terminal server machine, the crash appears to happen at exactly
10,000 user objects (as shown by task manager). On my system, it happens

at
around 7,000 user objects. In this state, all of windows becomes unstable. Some windows will not show up, others will disappear. It seems like after some time, windows will decide to shut down the app hogging all the
resources. This took a very long time on the terminal server machine.

I have written a small test project, all it does is pop up a form with

about
a hundred controls on it. Once you pop up about 30 of these forms, you can see the problem. I can post the code here, if anyone wants it.

So what is the limit with resources? How are we supposed to handle this?

At
a client site, when the error comes up, they see the JIT debugger error

box.
Any help or references would be greatly appreciated.

Niall


Nov 15 '05 #5
See inline ***
"Niall" <as**@me.com> wrote in message
news:el******** ******@TK2MSFTN GP09.phx.gbl...
Is a "desktop" one user session?
**** No, each user session is presented a virtual Winstation/desktop secured
environment (kind of a sandbox), from which WinSta0/default is the default
interactive pair.
Is this 48MB heap the same size on all NT based OS's (NT, XP, 2003, etc), or do some have different sizes?

**** No, the same size except for TS where this is reduced to 36MB.

However, I've done some further research on the number of USER objects, and
unfortunately here you hit the ceiling.
The number of USER handles per process is max., you guessed 10.000 (W2K and
W2K3).
The value as found at :
HKLM/Software/Microsoft/Windows
NT/CurrentVersion/Windows/USERProcessHand leQuota

Is unfortunately also the maximum value.

So I.M.O it's time to inspect your application as it looks like you are
leaking USER object handles (objects to watch are menu's, Icons, Windows and
cursors).

Willy.


Nov 15 '05 #6
Willy, thanks very much for your posts, I've learned a lot from them. That
10,000 flat user object count seemed to be a bit too round a number to have
been chance.

In regards to user object leaks, I've inspected the behaviour and there
don't seem to be any leaks. The situation in which I was seeing this
behaviour was when I simultaneously opened a large number of one of the most
complex forms in the app. I wasn't aware that this kind of situation could
still be a problem in NT based OSs. So at the moment, I am wondering if we
should put in some way of managing the maximum number of windows that can be
opened at one time.

Trouble is that I don't know how to tell how much of the system resources
are still available. Ie: we can limit the app to a reasonable number of
forms, but if the user has a lot of other apps open, they still may be able
to get into trouble. Perhaps it's not a situation we should worry about too
much. My testing was a deliberate attempt to induce bad behaviour in the
app, and it took a fair bit of effort :P

Thanks again,

Niall

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:eH******** ******@TK2MSFTN GP10.phx.gbl...
See inline ***
"Niall" <as**@me.com> wrote in message
news:el******** ******@TK2MSFTN GP09.phx.gbl...
Is a "desktop" one user session?
**** No, each user session is presented a virtual Winstation/desktop

secured environment (kind of a sandbox), from which WinSta0/default is the default
interactive pair.
Is this 48MB heap the same size on all NT based OS's (NT, XP, 2003,
etc), or
do some have different sizes?
**** No, the same size except for TS where this is reduced to 36MB.

However, I've done some further research on the number of USER objects,

and unfortunately here you hit the ceiling.
The number of USER handles per process is max., you guessed 10.000 (W2K and W2K3).
The value as found at :
HKLM/Software/Microsoft/Windows
NT/CurrentVersion/Windows/USERProcessHand leQuota

Is unfortunately also the maximum value.

So I.M.O it's time to inspect your application as it looks like you are
leaking USER object handles (objects to watch are menu's, Icons, Windows and cursors).

Willy.

Nov 15 '05 #7
Niall,

Note that the number of User objects (10000 max.) is a per process limit,
this is a whole lot to consume and should never be reached, unless you're
leaking handles.
That means you can have a number of applications running, each consuming
several thousand UO's, in parallel. But on TS you will probably run into a
lack of GDI resource space (the famous 36MB vs. 48MB desktop heap).

I would suggest you read the guidelines for application development for
Terminal server environments, this can be found in the platform SDK docs .

Willy.

"Niall" <as**@me.com> wrote in message
news:eK******** ******@TK2MSFTN GP10.phx.gbl...
Willy, thanks very much for your posts, I've learned a lot from them. That
10,000 flat user object count seemed to be a bit too round a number to have been chance.

In regards to user object leaks, I've inspected the behaviour and there
don't seem to be any leaks. The situation in which I was seeing this
behaviour was when I simultaneously opened a large number of one of the most complex forms in the app. I wasn't aware that this kind of situation could
still be a problem in NT based OSs. So at the moment, I am wondering if we
should put in some way of managing the maximum number of windows that can be opened at one time.

Trouble is that I don't know how to tell how much of the system resources
are still available. Ie: we can limit the app to a reasonable number of
forms, but if the user has a lot of other apps open, they still may be able to get into trouble. Perhaps it's not a situation we should worry about too much. My testing was a deliberate attempt to induce bad behaviour in the
app, and it took a fair bit of effort :P

Thanks again,

Niall

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:eH******** ******@TK2MSFTN GP10.phx.gbl...
See inline ***
"Niall" <as**@me.com> wrote in message
news:el******** ******@TK2MSFTN GP09.phx.gbl...
Is a "desktop" one user session?

**** No, each user session is presented a virtual Winstation/desktop

secured
environment (kind of a sandbox), from which WinSta0/default is the default interactive pair.
Is this 48MB heap the same size on all NT based OS's (NT, XP, 2003,

etc),
or
do some have different sizes?

**** No, the same size except for TS where this is reduced to 36MB.

However, I've done some further research on the number of USER objects,

and
unfortunately here you hit the ceiling.
The number of USER handles per process is max., you guessed 10.000 (W2K

and
W2K3).
The value as found at :
HKLM/Software/Microsoft/Windows
NT/CurrentVersion/Windows/USERProcessHand leQuota

Is unfortunately also the maximum value.

So I.M.O it's time to inspect your application as it looks like you are
leaking USER object handles (objects to watch are menu's, Icons, Windows

and
cursors).

Willy.


Nov 15 '05 #8

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:%2******** *******@TK2MSFT NGP11.phx.gbl.. .
Niall,

Note that the number of User objects (10000 max.) is a per process limit,
this is a whole lot to consume and should never be reached, unless you're
leaking handles.
We don't have a handle leak problem, as far as I'm aware. I was able to
create this behaviour by opening a lot of copies of a very large form (it
has a lot of tabs with subsections on them). I was a bit surprised at how
many objects were used by this form, even though it is very large. Each
instance uses around 800 user objects and around 300 GDI objects. There's
nothing amazing on the form, it's all just managed controls, so we're not
doing anything out of the ordinary. Small forms in our system are taking
around 20-30 user objects and around 5-10 GDI objects.

One thing I'm confused about is this: I thought window handles, brushes, etc
were all GDI objects. So how come our forms use more user objects than GDI
objects?

That means you can have a number of applications running, each consuming
several thousand UO's, in parallel. But on TS you will probably run into a
lack of GDI resource space (the famous 36MB vs. 48MB desktop heap).

I would suggest you read the guidelines for application development for
Terminal server environments, this can be found in the platform SDK docs .


Sounds like a good idea. Thanks again for your insight.

Niall
Nov 15 '05 #9
Hello,

I was wondering if 48mb is the heap sum limit in Windows 2003 Server
(Enterprise/Datacenter) as well.

If so is it changable?

In spite of the fact that this is a very old conversation, i'm hoping
for your asistance.

Thanks!

Eyal Weinreb
Israel
Ne******@hotmai l.com

Nov 16 '05 #10

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

Similar topics

0
1470
by: S.Chang | last post by:
Hi, just a quick question, what kind of system load to expect to run a medium/large scale weblog? the back end servers will be updaing the page quiet often, almost once per minute per servers. I wasn't too keen on using weblog, I thought it will drains a lot of system resource just like Zope and the other CMF, but after seeing blogs.sun.com, I am impressed and thinking to change the portal server in the lab with weblog.
1
1759
by: John Veldthuis | last post by:
I have a program which is using a Notify control for a tray icon. I originally had the icon for this separate as I have to change it all the time. When the icon was in the directory it worked fine but since I move it into the Resource area it does not. It looks like the Icon is the full 32x32 on the tray. Partial code is below. 1st the original and second the changed. I have been unable to find any way of getting this to work properly. I...
1
2338
by: Slim | last post by:
What are the pros and cons of using ADODB in ASP.NET v System.Data namespace? I not refereeing to supplying data to controls but for manipulating with code. I prefer to use ADODB, but is there any performance benifits from using System.Data namespace? thanks
3
1733
by: Steve Barnett | last post by:
A question on resource usage please. I have a custom control that I paint myself. As part of the code, I have several places where I include code like: canvas.FillRectangle(new SolidBrush(thisNode.EntityColor), colourType); This fills a small rectangle using an identifying colour for the line being displayed. There may be any number of different identifying colours. Am I consuming resources that are likely to be leaked or held on to...
7
13493
by: Kurda Yon | last post by:
Hi everybody, I cannot understand the following thinks. The last line of the fillowing code produces a message about mistake (not a valid MySQL- Link resource): $link = mysql_connect( "localhost","tmp_user","tmpxxx" ); mysql_select_db( $db_name, $link); $link = mysql_connect( "localhost","tmp_user","tmpxxx" ); mysql_close( $link );
2
3988
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise>asant database Buildfile: build.xml env-user: prop-user: set-user:
2
4553
by: =?Utf-8?B?U2Fs?= | last post by:
<I MOVED THIS POST TO ITS OWN THREAD. ORIGINAL POST FOUND HERE: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.framework.webservices&mid=22d09e8e-4390-46b2-b266-ff37405d68ba > I've been searching around the forums for answers to this but not finding anything substantial. My env is XP Pro / .NET 2.0. The web service in question is written in Java on a WebLogic box. I can open the wsdl in IE...
1
1745
by: Michael | last post by:
Hi. Could anyone help me out with this one. I have a aspx page from where users may send invites to other users. When the user clicks the "send invite"-button an email is generated. Now here's the case: I'm interested in sending the email in the language chosen by the user.
0
9923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10711
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...
0
9549
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
7939
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
7104
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
5774
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...
0
5967
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4592
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
2
4190
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.