octopkg - couldn't lock 16384 bytes of memory (libgcrypt)

News and Announcements related to GhostBSD
Post Reply
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

octopkg - couldn't lock 16384 bytes of memory (libgcrypt)

Post by ASX »

I was using octopkg, (github version) just for test, it worked fine a couple of days.
Suddenly I have got the error in subject, more precisely, when refreshing the pkg database, the output window shown:

couldn't lock 16384 bytes of memory (libgcrypt): Resource temporarily unavailable

a fast search around the problem highlighted the fact it was probably related to gnome-keyring, a short mail exchange with octopkg author confirmed that the problem is restricted to gnome environment and that kdesu always work correctly.

A further search directed me to mlock(2) and the related man page says:
Since physical memory is a potentially scarce resource, processes are
limited in how much they can lock down. The amount of memory that a sin-
gle process can mlock() is limited by both the per-process RLIMIT_MEMLOCK
resource limit and the system-wide ``wired pages'' limit vm.max_wired.
vm.max_wired applies to the system as a whole, so the amount available to
a single process at any given time is the difference between vm.max_wired
and vm.stats.vm.v_wire_count.
my values at error time:

$ sysctl vm.max_wired
vm.max_wired: 326864

$ sysctl vm.stats.vm.v_wire_count
vm.stats.vm.v_wire_count: 377931

as you can see the second value already exceed the system wide limit above.
The solution is to tweak the kernel limits:

sudo sysctl vm.max_wired=512000

and the error disappeared. :)
User avatar
ericbsd
Developer
Posts: 2125
Joined: Mon Nov 19, 2012 7:54 pm

Re: octopkg - couldn't lock 16384 bytes of memory (libgcrypt

Post by ericbsd »

I did not try the GitHub one yet.
Post Reply