vere icon indicating copy to clipboard operation
vere copied to clipboard

~mopfel-winrux running into a memory issue

Open mopfel-winrux opened this issue 11 months ago • 1 comments

~mopfel-winrux has been running into a loom: fault mprotect error. I fixed this a couple of days ago with a |pack but it keep occurring. I'm copying a folder of my pier I can make available. My dojo output is below:

clay: read-at-tako fail [desk=%groups care=%c case=[%da p=~2024.3.19..19.25.31..20e0] path=/json/ui-vita]
[%no-cast-from %json %ui-vita]
[%error-building-cast %json %ui-vita]
[%error-building-tube %json %ui-vita]
%contacts: on-poke with mark %contact-action-0
eyre: missing subscription in unsubscribe 1710874934-fad5d8 55
loom: fault mprotect (197681): Out of memory
Assertion '0' failed in pkg/noun/manage.c:1810

bail: oops
home: bailing out
ames: packet dropped (272000 total)
pier: EOF
pier: work exit: status 0, signal 6

mopfel-winrux avatar Mar 19 '24 19:03 mopfel-winrux

That's mprotect() returning ENOMEM, which almost certainly means that we were trying to exceed the kernels max number of virtual-memory mappings (vm.max_map_count). mprotect() can increase the number of mappings by splitting ranges, for example: a single mapping of 3 read-only pages becomes 3 mappings if the middle page is changed to read/write.

The linux default per-process max is 65530, which is quite low. You can temporarily change the max with sysctl –w vm.max_map_count=..., or permanently change it by editing /etc/sysctl.conf.

Some more details and context:

  • https://www.suse.com/support/kb/doc/?id=000016692
  • https://github.com/torvalds/linux/blob/v5.18/include/linux/mm.h#L178
  • https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
  • https://fedoraproject.org/wiki/Changes/IncreaseVmMaxMapCount

joemfb avatar Mar 19 '24 20:03 joemfb