Agent2 on Windows leaks process handles when using UserParameters

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 6.0.45, 6.0.46
    • Component/s: Agent2 (G)
    • None
    • Environment:
      Windows Server 2019, Windows Server 2022

      Steps to reproduce:

      1. Install Zabbix Agent 2 version 6.0.45 or 6.0.46 on a Windows Sever 2019 or Windows Server 2022 host (likely affects other Windows versions, haven't tested).
      2. Configure one or more UserParameters in a conf file placed in the C:\Program Files\Zabbix Agent 2\zabbix_agent2.d directory (our standard conf file is attached as SpringhillUserParameters.conf).
      3. Attach a template to the host that includes Zabbix-agent-(active)-type items that collect the UserParameters.

      Result:
      The zabbix_agent2.exe process accumulates process handles. One tool that can be used to show the handles is the Sysinternals handle available from Microsoft. 

      handle -a -p zabbix_agent2.exe | find "Process"

      They also show up on the Processes tab of the Sysinternals RAMMap tool, but not in the standard Task Manager. This screenshot show the leaked handles, which appear as rows for the process "cmd.exe".

      This also results in increased memory usage. For us, the increased memory usage started to become a problem after about two weeks. Restarting zabbix_agent2.exe releases all of these handles and returns memory usage to normal.

      Expected:
      We that zabbix_agent2.exe doesn't own any process handles or a small number of handles for the commands that are currently executing. We reverted to 6.0.44 and don't observe leaked handles on any host running the older version.

        1. SpringhillUserParameters.conf
          3 kB
        2. screenshot-5.png
          screenshot-5.png
          10 kB
        3. screenshot-4.png
          screenshot-4.png
          9 kB
        4. screenshot-3.png
          screenshot-3.png
          64 kB
        5. screenshot-2.png
          screenshot-2.png
          12 kB
        6. screenshot-1.png
          screenshot-1.png
          12 kB
        7. image-2026-05-18-13-45-56-771.png
          image-2026-05-18-13-45-56-771.png
          138 kB
        8. image-2026-05-18-13-43-04-852.png
          image-2026-05-18-13-43-04-852.png
          321 kB

            Assignee:
            Zabbix Development Team
            Reporter:
            Jacob Tapia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: