SOrry, my mistake, the conversion type was wrong.
So restrict_get_process_size is indeed consistent with vsz_limit
Now, for the memory usage of the process, getrusage gives only the /max/ of the memory used, not the current
THe only way I found is to fopen("/proc/self/status") and read the correct line. Do you have a better way ?
thank you
On 2020-11-06 14:16, Joan Moreau wrote:
ok found it,
However, it returns me some random number. Maybe I am missing something
On 2020-11-06 13:57, Aki Tuomi wrote: Duh... src/lib/restrict-process-size.h
Should be in the installed include files as well,
/usr/include/dovecot/restrict-process-size.h
Aki
On 06/11/2020 15:56 Joan Moreau jom@grosjo.net wrote:
Hello I can't find "src/lib/restrict.h" . Is it in dovecot source ?
On 2020-11-06 13:20, Aki Tuomi wrote: Seems I had forgotten that you can use src/lib/restrict.h, in particular, restrict_get_process_size() to figure out the limit. You can combine this with getrusage to find out current usage.
Aki
On 06/11/2020 13:26 Joan Moreau jom@grosjo.net wrote:
yes, will do so. It would be nice however to be able to access the actual dovecot config from the plugin side
On 2020-11-04 06:46, Aki Tuomi wrote: You could also add it as setting for the fts_xapian plugin parameters?
Aki
On 04/11/2020 08:42 Joan Moreau jom@grosjo.net wrote:
For machines with low memory, I would like to detect how much ram remains available before starting indexing a mail, so I can commit everything on disk before the ram is exhausted (and break the process) I tried to put a "fake" allocation to test if it fails, (so it can fail separately, and I can "if ram remaining is above X") but the is really not clean
On 2020-11-04 06:28, Aki Tuomi wrote:
On 04/11/2020 05:19 Joan Moreau jom@grosjo.net wrote:
Hello I am looking for help around memory management 1 - How to get the current value of "vsz_limit" from inside a plugin (namely https://github.com/grosjo/fts-xapian/ ) , especially for indexer-worker 2 - Is there a macro or function in dovecot to get the remaining free memory from this vsz value ? Thank you
Hi Joan,
I don't think there is a feasible way to access this setting as of now. Is there a reason you need this? We usually recommend setting vsz_limit=0 for indexer-worker.
Aki