From bdf97fabd0419b14e07b0018c9886b71eb04efca Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Mon, 2 May 2011 20:10:37 +0000 Subject: [PATCH] 4322: Upgrading a large database to new version runs out of memory; increase locktable size svn: r17385 --- src/gen/db/dbconst.py | 4 ++-- src/gen/db/write.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gen/db/dbconst.py b/src/gen/db/dbconst.py index 83578248d..f1e4b7edb 100644 --- a/src/gen/db/dbconst.py +++ b/src/gen/db/dbconst.py @@ -59,8 +59,8 @@ DBMODE_W = "w" # Full Reaw/Write access DBPAGE = 16384 # Size of the pages used to hold items in the database DBMODE = 0666 # Unix mode for database creation DBCACHE = 0x4000000 # Size of the shared memory buffer pool -DBLOCKS = 25000 # Maximum number of locks supported -DBOBJECTS = 25000 # Maximum number of simultaneously locked objects +DBLOCKS = 100000 # Maximum number of locks supported +DBOBJECTS = 100000 # Maximum number of simultaneously locked objects DBUNDO = 1000 # Maximum size of undo buffer from bsddb.db import DB_CREATE, DB_AUTO_COMMIT, DB_DUP, DB_DUPSORT, DB_RDONLY diff --git a/src/gen/db/write.py b/src/gen/db/write.py index 531785900..26b6a3396 100644 --- a/src/gen/db/write.py +++ b/src/gen/db/write.py @@ -1016,6 +1016,11 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): return self.env.txn_checkpoint() + lockstats = self.env.lock_stat() + _LOG.debug("lock occupancy: %d%%, locked object occupancy: %d%%" % ( + round(lockstats['maxnlocks']*100/lockstats['maxlocks']), + round(lockstats['maxnobjects']*100/lockstats['maxobjects']))) + self.__close_metadata() self.name_group.close() self.surnames.close()