Managing Memory
glibc
enhances performance by aggressively holding onto memory, even if that memory is not being
used at the time by a process. The Linux kernel's Out of Memory (OOM) Killer may terminate the
Vertica process if it uses too much memory.
You can avoid this by setting the
MALLOC_ARENA_MAX
environment
variable to a nonzero value, which limits the number of arenas (memory pools available to malloc()
)
a process can use.
If you have write privileges on ~/.bashrc
, perform the following steps on all nodes:
- Run the following command to set MALLOC_ARENA_MAX:
- Log out and back in.
- Restart the Vertica database.
- Verify that MALLOC_ARENA_MAX is set:
$ export MALLOC_ARENA_MAX=4
$ set | grep ARENA MALLOC_ARENA_MAX=4
If you don't have write privileges on ~/.bashrc
, you must always start the database with the
VERTICA_ADMINTOOLS_PASSTHROUGH
environment variable.
- Always run the following command to start the database:
- Verify on each node that MALLOC_ARENA_MAX is set for the process:
$ export VERTICA_ADMINTOOLS_PASSTHROUGH=MALLOC_ARENA_MAX=4 admintools -t start_db -d database_name
$ xargs --null --max-args=1 echo < /proc/$(pgrep vertica$)/environ | grep ARENA MALLOC_ARENA_MAX=4