Subject Re: [firebird-support] Firebird 2.1 hangs, log says "Database: ThreadData::start() failed"
Author Daniel Albuschat
Hi Mark,

2010/4/20 Mark Rotteveel <Avalanche1979@...>:
>> today our Firebird Server (version, super server on win32)
>> did not allow new connections and was EXTREMELY slow. Ultimately, I
>> had to restart the fbserver process.
>> When I had a look at the logs, I saw this entry numerous times
>> (about... 10.000 times in ~20 minutes):
>> RIKER (Server)        Tue Apr 20 15:02:10 2010
>>       Database: ThreadData::start() failed:
>>       operating system directive _beginthreadex failed
>>       unknown Win32 error 8
>> Win32 error 8 supposedly means "Out of Memory" according to this list on
>> MSDN:
>> The server runs Windows 2008 Server 64 bit and has a total of 16 GB of
>> RAM installed, of which not even half is in use. The Firebird Server
>> process was using something like ~1.500 MB of it when it was still
>> "running" (or rather idling, since it had 0,00% CPU usage).
> If you run a 32 bit process on Windows 64, that process can still only use a maximum of 2GB of memory. That is inherent to the implementation of 32 bit processes on Windows. If you use Windows 64, why not run 64 bit Firebird?

Ah.... you're right. I blindly assumed I was using a 64 bit Firebird
server, but it's a 32 bit binary. So it actually *was* an out of
memory error.
But what's the reason that Firebird uses up so much RAM? That's surely
not desired behaviour. Does Firebird know that it's limit is 2GB, even
though more physical memory is available? Or does it assume that there
is enough free RAM and tries to allocate more?

> Depending on the memory allocation model of the Firebird it, it could even be lower than 2GB. For example Java uses a contiguous allocation model where the maximum virtual memory size is allocated at startup. If the virtual memory is fragment by other processes loaded it can sometimes only allocate 1.2 to 1.8 GB of memory).

Thanks for the pointer. I'd still like to know how I can prevent this
in the future ;(



eat(this); // delicious suicide