[systemd-devel] systemd-journalctl Failed to iterate through journal: Cannot allocate memory

Lennart Poettering lennart at poettering.net
Mon Apr 2 07:47:00 PDT 2012


On Thu, 29.03.12 15:42, David Lambert (dave at lambsys.com) wrote:

> Thanks Lennart, it looks like your guess was spot on! See attached
> trace. Any suggestions on how to narrow this down further?

So, this is probably simply because we try to map 128M of each journal
file by default, which is not much of a problem on a machine with 64bit
address space (like the one i use), but might be on a 32bit
system. (leaves < 16 mappings only, which means you can only have less
than 16 journal files around that we need to interleave).

I have now reduced the default mapping size to 8M, which leaves < 256
mappings. Should be enough for a while, but if this turns out to be too
little still, then we can implement some logic so that we unmap mappings
dynamically if we have too many of them.

The default window size can be controlled with the DEFAULT_WINDOW_SIZE
macro at the top of src/journal/journal-file.c.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list