Firebird Connection pool is full

今天在做Firebird V3.0.3  x64 版本内存测试,本地PC上,准备开启800个事务(保持不关闭),每个事务做些事,尽量不释放内存。

每次测试当事务数达到100时,就提示Connection pool is full,此时内存才吃到500+MB。

在系统配置里没有一个选项是最大连接数,最后发现是在连接字符串里,有个选项是 MaxPoolSize 。

令 MaxPoolSize = 1000 ,程序敞开跑,最后后台进程用到 5GB多,PC内存不够了。

以下是连接字符串:

 1 FbConnectionStringBuilder connBuilder = new FbConnectionStringBuilder();
 2 connBuilder.DataSource = "localhost";
 3 connBuilder.UserID = "sysdba";
 4 connBuilder.Password = "123456";
 5 connBuilder.Database = "x";
 6 connBuilder.Charset = "utf8";
 7 connBuilder.ServerType = FbServerType.Default;
 8 connBuilder.Dialect = 3;
 9 connBuilder.MaxPoolSize = 1000;
10 connBuilder.Pooling = true;
11 _connStr = connBuilder.ConnectionString;

测试程序:

 1     for (int i = 0; i < 800; i++)
 2     {
 3         var db = DbCtxt.NewDbContext().UseTransaction(true);
 4         for (int j = 0; j < 500; j++)
 5         {
 6             db.Insert("m_user").Column("code", "1234567890")
 7                 .Column("label", "ABCDEFGHIJ")
 8                 .Column("pwd", "1234").Column("is_del", false).Execute();
 9         }
10     }

内存占用:

原文地址:https://www.cnblogs.com/jonney-wang/p/9275617.html

时间: 2024-10-31 17:03:02

Firebird Connection pool is full的相关文章

Tomcat数据源--DataSource&amp;Connection Pool

连接池:连接池是由容器(比如Tomcat)提供的,用来管理池中的连接对象.连接池自动分配连接对象并对闲置的连接进行回收.连接池中的连接对象是由数据源(DataSource)创建的.连接池(Connection Pool)用来管理连接(Connection)对象. 数据源:数据源(DataSource)用来连接数据库,创建连接(Connection)对象. java.sql.DataSource接口负责建立与数据库的连接 由Tomcat提供,将连接保存在连接池中. JNDI(Java Naming

数据库操作的异常Cannot perform this operation because the connection pool has been close

============问题描述============ 异常日志如下: Caused by: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. at android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked(SQLiteConnectionPool.java:

Cannot get a connection, pool error Timeout waiting for idle object

Cannot get a connection, pool error Timeout waiting for idle object 异常原因 一直有hibernate的session在开启并偿试打开新连接,导致最终没有空闲链接可用. PCISV7-VHL [2017-09-07 19:10:13,625]>>>ERROR>>>[ com.isoftstone.fwk.dao.BaseDao.getNewConnection(BaseDao.java:1534) ]-

JDBC -- Connection Pool

Connection Pool: create many connection objects in advance, and put the connection into the cache(list). The client will get the connection from the cache, return the connectio to the cache after using it. This way could improve the access effeciency

Cannot get a connection, pool exhausted解决办法

http://blog.163.com/it_message/blog/static/8892051200908102032653/ 连接池(Tomcat+oracle),运行一段时间后就会出现 Cannot get a connection, pool exhausted这样的异常.其实这个问题很简单就是数据库connection对象用尽了. 解决的办法有3个 1重启服务器 2在content.xml中,将maxActive设置为零,或者调高它的值 3在你的程序中正确关闭connections

Android开发中使用数据库时出现java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.

最近在开发一个 App 的时候用到了数据库,可是在使用数据库的时候就出现了一些问题,在我查询表中的一些信息时出现了一下问题: Caused by: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. at android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked(

java.lang.IllegalStateException: Connection pool shut down

最近使用HttpClient 4.5 使用 CloseableHttpClient 发起连接后,使用CloseableHttpResponse 接受返回结果,结果就报错了,上网查了下,有位stackoverflow的大兄弟说,只要将: CloseableHttpClient httpClient = HttpClients.createDefault(); 改为: CloseableHttpClient httpClient = HttpClients.custom().setConnectio

How to implement connection pool in spark streaming

在spark streaming的文档里,有这么一段: def sendPartition(iter): # ConnectionPool is a static, lazily initialized pool of connections connection = ConnectionPool.getConnection() for record in iter: connection.send(record) # return to the pool for future reuse Co

Jmeter JDBC Connection Configuration 链接失败,提示Error preloading the connection pool

修改数据配置的连接数即可:修改为小一点 下面是oracle 配置连接的方式 原文地址:https://www.cnblogs.com/x2x3/p/10683453.html