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

memory allocator uses more memory for internal purposes than it should

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 2.2.1
    • Proxy (P), Server (S)
    • Sprint 51 (Apr 2019), Sprint 52 (May 2019), Sprint 53 (Jun 2019), Sprint 54 (Jul 2019), Sprint 57 (Oct 2019)
    • 3

      After ZBXNEXT-322 was implemented in r36765, the memory allocator started using more memory for internal purposes than it should.

      Namely, consider the description of memory allocator at the beginning of src/libs/zbxmemory/memalloc.c. There it is described how a chunk looks like. At the beginning and at the end of the chunk there is the size of the chunk. Before r36765, it used to be 4 bytes on each side for a total of 8 bytes. Now, it is 8 bytes on each side for a total of 16 bytes. So each free and allocated chunk now uses 8 bytes more of memory.

      The rationale for the change was that the maximum size for value cache is 64 GB, so 4 bytes is no longer enough to represent that free chunk size. However, since we never allocate more than 2 GB (which itself is extremely unlikely), we can split the initial free chunk of 64 GB into several smaller chunks of free memory.

            zabbix.dev Zabbix Development Team
            asaveljevs Aleksandrs Saveljevs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: