Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26542

Memory allocation pre-flight check feature

    XMLWordPrintable

    Details

      Description

      A command like

      SET @@GLOBAL.key_buffer_size=10000000000000000000;
      

      Cannot possibly succeed when a limited amount of free memory is available.

      However, both optimized and debug builds will immediately commence executing the command and attempt memory allocation, thereby quickly and needlessly filling up all available memory, leading to OOM termination by the kernel of either this process or any other running on the server, and all consequences thereof.

      This feature request for a simple pre-flight check. Pseudo code:

      IF requested_alloc_amount > (free_mem * 1.3) THEN print_error AND do_not_execute_request;
      ELSEIF requested_alloc_amount > (free_mem * 0.87) THEN print_warning AND execute_request;
      ELSE execute_request;
      

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration