Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nora Puchreiner
Nix
Commits
c25f2883
Commit
c25f2883
authored
20 years ago
by
Eelco Dolstra
Browse files
Options
Downloads
Patches
Plain Diff
* Quadruple the Berkeley DB locking limits to get rid of out of memory
errors while running `nix-store --verify'.
parent
fe122c5a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libstore/db.cc
+21
-2
21 additions, 2 deletions
src/libstore/db.cc
with
21 additions
and
2 deletions
src/libstore/db.cc
+
21
−
2
View file @
c25f2883
...
...
@@ -165,11 +165,30 @@ void Database::open(const string & path)
DbEnv
*
env
=
0
;
/* !!! close on error */
env
=
new
DbEnv
(
0
);
/* Smaller log files. */
env
->
set_lg_bsize
(
32
*
1024
);
/* default */
env
->
set_lg_max
(
256
*
1024
);
/* must be > 4 * lg_bsize */
env
->
set_lk_detect
(
DB_LOCK_DEFAULT
);
/* Write the log, but don't sync. This protects transactions
against application crashes, but if the system crashes,
some transactions may be undone. An acceptable risk, I
think. */
env
->
set_flags
(
DB_TXN_WRITE_NOSYNC
|
DB_LOG_AUTOREMOVE
,
1
);
/* Increase the locking limits. If you ever get `Dbc::get:
Cannot allocate memory' or similar, especially while
running `nix-store --verify', just increase the following
number, then run db_recover on the database to remove the
existing DB environment (since changes only take effect on
new environments). */
env
->
set_lk_max_locks
(
4000
);
env
->
set_lk_max_lockers
(
4000
);
env
->
set_lk_max_objects
(
4000
);
env
->
set_lk_detect
(
DB_LOCK_DEFAULT
);
/* Dangerous, probably, but from the docs it *seems* that BDB
shouldn't sync when DB_TXN_WRITE_NOSYNC is used, but it
still fsync()s sometimes. */
db_env_set_func_fsync
(
my_fsync
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment