On 8/5/25 09:43, Daniel Schwartz wrote:
Well, I guess that this is a top post. But this message is getting
longer with all the replies. I don’t think it is a memory leak. I’m
fairly sure that I’m closing every connection immediately after using
it. It seems that most of my database
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.
ZjQcmQRYFpfptBannerEnd
Well, I guess that this is a top post. But this message is getting longer with
all the replies.
I don’t think it is a memory leak. I’m fairly sure that I’m closing every
connection immediately after using it. It seems that most of my database
queries are coming from web crawlers, and there are a few hundred accesses
every day. I was getting error messages from Glassfish saying that it couldn’t
allocate any more connection objects and then crashing. At that time the
maximum pool size was the default, which is 32. So I believe it was just being
overloaded by the web crawlers. Now that I have increased to 1000, the system
has stopped crashing.
But I have to admit that I really don’t understand how these connection pooling
systems work. My understanding is that only as many connection objects are
created and placed in the pool as are needed, so even if you set the upper
limit high it doesn’t necessarily mean that you will have that many. Once a
database session terminates, then that connection object becomes available for
future use. So at any given time, the number of connection objects in the pool
would be the maximum number of simultaneous connections that have been made so
far, and not necessarily the total maximum that are allowed (in my case 1000).
Is this correct?
Dan Schwartz
The default is a reasonable number depending upon traffic. Is your site
fairly busy? We manage a fairly busy site with lot database activity and
even then we don't have to go 1000 connections which essentially might
boil down to 1000 concurrent requests. Are you really getting that many
requests simultaneously? As others have indicated there is a good chance
you have connection and/or other resource leaks in your code. There are
some debugging hints posted like setting max connections to 1 in your
dev environment and see if it works cleanly.