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:

  1. Run the following command to set MALLOC_ARENA_MAX:
  2. $ export MALLOC_ARENA_MAX=4
  3. Log out and back in.
  4. Restart the Vertica database.
  5. Verify that MALLOC_ARENA_MAX is set:
  6. $ 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.

  1. Always run the following command to start the database:
  2. $ export VERTICA_ADMINTOOLS_PASSTHROUGH=MALLOC_ARENA_MAX=4 admintools -t start_db -d database_name
  3. Verify on each node that MALLOC_ARENA_MAX is set for the process:
  4. $ xargs --null --max-args=1 echo < /proc/$(pgrep vertica$)/environ | grep ARENA
    MALLOC_ARENA_MAX=4