Re: How to estimate the upper bound of the peak memory consumption of cryptsetup itself?

Milan Broz <[email protected]>
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
On 24/06/2022 12:49, Coiby Xu wrote:
>>> Thanks for the reply! Sorry I meant the way to estimate the overhead of
>>> crypsetup itself i.e. ~256M in the above example. Previously I only take
>>> the memory consumption by memory-hard KDF into consideration and
>>> neglected the memory consumption of cryptsetup itself. This obviously
>>> leads to an underestimation of the memory requirement of cryptsetup. I
>>> need to overestimate the memory requirement a bit to make sure OOM won't
>>> happen that's why I am asking if there is a way to estimate the
>>> upper bound of memory requirement of cryptsetup itself.
>>
>> There is no generic way to get a number - it depends on configuration
>> of the distro, libc, translations, everything that is locked including
>> shared libraries.
>>
>> If it is about RHEL, you can perhaps know exact configuration - please
>> ask people in Red Hat.
> 
> Provided the configuration, is there an golden algorithm or a formula to
> get the number? If it doesn't exist and I need to do some tests to get
> an empirical number, are there any big factors I need to be aware of?

Think about current locales, OpenSSL policy and many other things.
(The major I remember was locking all libc loaded translations in memory.)

So really, the only answer here would be ... 42 :)

You can try to measure it. Not sure if it is reliable.

Usually people want to know this for some weird scenarios like kdump
or so - this is definitely not something upstream can help with.

Milan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.