Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-13259

Out of Memory on host.delete method

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 3.4.4
    • API (A)
    • None

      If you try delete hosts with more than 16k items, 384MB of memory in php.ini isn't sufficient using zabbix api or frontend, having "out of memory" error in log.

      I think that 384MB of memory for delete is quite huge, so i analize the error:

      Allowed memory size of 402653184 bytes exhausted (tried to allocate 72 bytes) in /usr/share/zabbix/include/classes/db/DB.php on line 502"

      Close to the line cited the function called is insertBatch. For me, the variable $values not should be updated, because isn't used in code.

      foreach ($values as $key => $row) {
      if ($getids)

      Unknown macro: { $resultIds[$key] = $id; $row[$tableSchema['key']] = $id; $values[$key][$tableSchema['key']] = $id; $id = bcadd($id, 1, 0); }

      self::checkValueTypes($table, $row);
      $newValues[] = $row;
      }

      For test, i comment the line "$values[$key][$tableSchema['key']] = $id;" and the out of memory doesn't occur (the hosts are deleted correctly).

      maybe I did not understand the logic, but is necessary update $values in a foreach loop of $values if it is not reffered after setted?

      I think that update of $values is unnecessary, because allocate a lot of memory uselessly.

            Unassigned Unassigned
            alisson Alisson Ramos de Oliveira
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: