Re: 8.2.3: Server crashes on Windows using Eclipse/Junit

From: Dave Page <dpage(at)postgresql(dot)org>
To: Harald Armin Massa <haraldarminmassa(at)gmail(dot)com>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: 8.2.3: Server crashes on Windows using Eclipse/Junit
Date: 2007-10-23 16:22:11
Message-ID: 471E1FB3.6030008@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Harald Armin Massa wrote:
> Replying to myself....
>> Postgres is definitely NOT started as LocalSystem account; so using a
>> "logical not" on Microsofts Words that could indicate the reason why
>> our service-backends consume that memory? Add to this that MS SQL runs
>> as LocalSystem; and as much as I know also Oracle.
>
> just some lines further down:
>
> """Every service process executed under a user account will receive a
> new desktop in a noninteractive window station created by the Service
> Control Manager (SCM). Thus, each service executed under a user
> account will consume the number of kilobytes of desktop heap specified
> in the third SharedSection value. All services executed under the
> LocalSystem account with Allow Service to Interact with the Desktop
> not selected share the desktop heap of the "Default" desktop in the
> noninteractive service windows station (Service-0x0-3e7$)."""
>
>
> it is exactly as suspected ... just starting the service allocates that heap

You're missing the point I think. There's 48MB (iirc) on XP that is
reserved for desktop heaps. From that, it allocates 64KB for
WinSta0\Disconnect, 128KB for WinSta0\Winlogon and 3072KB for
WinSta0\Default (ie. the regular desktop). Each additional session
started by the SCM gets allocated the non-interactive default of 512KB.

It's not the 48MB we're running out of, it's the 512KB. That's why if
you look back in the thread, you'll see I found 8.3 was crashing with 46
connections when running as a service, but with much higher numbers of
connections when run from the logon session.

The reason why Microsoft services don't consume so much heap is that
they are multi-threaded, not multi-process so they don't init user32.dll
etc. for each individual connection like we do, but only once for the
whole server.

/D

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Trevor Talbot 2007-10-23 16:43:33 Re: 8.2.3: Server crashes on Windows using Eclipse/Junit
Previous Message Harald Armin Massa 2007-10-23 16:13:44 Re: 8.2.3: Server crashes on Windows using Eclipse/Junit

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2007-10-23 16:22:31 Re: Feature Freeze date for 8.4
Previous Message Tom Lane 2007-10-23 16:19:11 Re: Latin vs non-Latin words in text search parsing