Running Out Of Resources (Even With Lots Of RAM Installed)

by Jon Davis 10. March 2009 13:33

“.. Ask yourself if you have ever encountered any of the following problems :-

    1. You try to open an application but it refuses to load or it starts to load and then it disappears!
    2. You try to open or use an application but you get an "Out Of Memory" error message!
    3. One of your running applications inexplicably quits!
    4. When you right-click on your application, nothing happens! The command menu refuses to pop-up!
    5. Your web browser simply refuses to load any more windows or tabs!
    6. Your application is missing some menus or toolbars!
    7. You get the following error messages :
               Initialization of the dynamic library <system>\system32\user32.dll failed. The process is terminating abnormally.
               Initialization of the dynamic library <system>\system32\kernel32.dll failed. The process is terminating abnormally.”

I’m shocked I never blogged this. Over at Coding Horror there was an article that was posted wherein in the comments section someone pointed me here:

http://www.techarp.com/showarticle.aspx?artno=238&pgno=0

It’s a 3-page article describing how to reconfigure your desktop heap so that you don’t keep running out of system resources. I’ve gone back to 32-bit XP w/ 4GB RAM at the office and needed to look this up again because I was still getting erratic behavior—more so, actually, because more RAM meant less hesitancy to open things up. A co-worker got the RAM, too, so I had to look it up yet again. It’s definitely worth looking at if you open lots of apps and/or web browser windows like I do.

In case that article goes down, it goes something like this:

Go to HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control -> Session Manager –> SubSystems -> Key: Windows

If you check the Value data for the Windows key, it should be something like this :-

%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16

The portion of interest is "SharedSection=1024,3072,512".
The three values under Shared Section determines how much memory in kilobytes (KB) is allocated to each component of the desktop heap.

The first value is the shared heap size, common to all desktops. It's used to store the global handle table and shared system settings.

By default, it's set to 1024KB. You generally do not need to modify this value.

The second value is the desktop heap size for each desktop associated with the "interactive" window station. It's used to store user objects like hooks, menus, strings and windows.

By default, it's set to 3072KB. The more users log into the system, the more desktops are created. Consequently, the total "interactive" desktop heap size will increase to reflect the number of desktops created. But each desktop will only have an "interactive" desktop heap of 3072KB.

The third value is the desktop heap size for each desktop associated with the "non-interactive" window station.

By default, it's set to 512KB. But if this value is not present, the size of the "non-interactive" window station will be the same as that of the "interactive" window station.

Every service process created under a user account will be given a new desktop in a "non-interactive" window station created by the Service Control Manager (SCM). Therefore, each of these services will consume the amount of desktop heap, as specified in the third SharedSection value.

I’m guessing here but it looks like the desktop heap size should only be limited if you’re using Windows Server and Terminal Services, as I’m not sure how you can measure “the more users that log onto the desktop” outside of Terminal Services. Even Remote Desktop is a single-desktop experience.

I have mine reconfigured to:

%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,6144,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16

Not sure if that’s right but the system does still boot and I haven’t run into problem much anymore.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Computers and Internet | Microsoft Windows

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading




 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  October 2020  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar