On 11/29/07, Laurent Duperval <lduperval@xxxxxxxxx> wrote: > To summarize: when I run unit tests with eclipse (and with Ant) on > Windows, at some point, I run out of available connections. I tried > increasing the maximum number of connections, but then I started seeing > the postgres server die and restart. The conclusion was that under Windows XP, postgres is normally limited to a maximum of 125-150 connections. Raising max_connections higher than that will lead to the crashes you saw. > > Rainer Bauer wrote: > >> After increasing the session heap size in the registry from 512KB to 1024KB > >> the no. of connections was roughly doubled. So this might be a solution for > >> people running out of Desktop heap. > >> > >> Alter the value of the following key > >> <HKLM\System\CurrentControlSet\Control\Session Manager\SubSystems\Windows> > >> > >> The numeric values following "SharedSection=" control the heap management: > >> On WinXP these are the default values: "SharedSection=1024,3072,512" > >> Altering this to "SharedSection=1024,3072,1024" will increase the heap for all > >> non-interactive window stations to 1024KB. > Does this allow creating more connections? At some point, the discussion > became too technical for me, and I no longer could tell if the answer was > for developers of for users. Yes. After making that change and restarting Windows, postgres will be able to safely handle 250-300 connections. > I saw other messages dealing with semaphores/connection relations, etc. > But unless I really did not understand the discussion, none of them seemed > to address the issue I was seeing. Right, we were just trying to find the precise resource limit that was causing the crash. > I'm thinking that the Java driver combined with Hibernate may be keeping > handles open for too long, because my tests aren't supposed to maintain > connections open for very long. I also would expect the connections to > either be closed or released once the statements are executed. This is where I would start on your problem. Increasing the max connections is one thing, but having so very many simultaneous operations in progress on your database is probably not productive, as it's likely to spend more time juggling tasks than actually performing them. I'm not familiar with Java tools, so someone else will have to chime in with specific suggestions. It may be something as simple as limiting how many tests JUnit/Ant tries to run at the same time, or some parameter buried in Hibernate or the driver. ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend