If you don't know the maxsize, you can set the MaxSize attribute to 0.
Then you have an illimited pool.
You can try it.
Be sure to set blocking true and use a blocking timeout. Then at least you won't get npe's.
Are you closing connections after you use them? This is how they are returned to the pool. Close them in a finally block.
I can't really recommend providing for infinite resource utilization by setting maxsize=0. Find out what the expected load is and size the pool accordingly.