[ZBX-23053] Memory leak with cert based encryption - Zabbix Agent 2 Windows Server 2019 Created: 2023 Jul 04  Updated: 2023 Sep 08  Resolved: 2023 Sep 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent2 plugin (G)
Affects Version/s: 6.4.4
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Bjoern Wentz Assignee: Karlis Salins (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Microsoft Windows Server 2019 Standard (Virtual machine) with Zabbix Agent 2 v6.4.4.2400
Zabbix Passive checks
Certificates with 2048 Bits keys


Attachments: PNG File service details.png    
Issue Links:
Duplicate
duplicates ZBX-23221 Memory leak when using encryption by ... Closed

 Description   

Steps to reproduce:

  1. Set "TLSConnect=cert", "TLSAccept=cert", "TLSCAFile=...", "TLSCertFile=...", "TLSKeyFile=..." in Agent config
  2. Set "Connections to host" and "Connections from host" to "Certificate" in Zabbix Web GUI
  3. Link template "Windows by Zabbix agent" to host

Result:
Memory usage of "zabbix_agent2.exe" is increasing constantly. We already saw it with over 4GB. While unencrypted, it consumes about ~20MB.
With "DebugLevel=5" I can see no error, just the following repeating for the different item requests:

2023/07/04 08:51:17.045131 connection established using TLSv1.3 TLS_CHACHA20_POLY1305_SHA256, peer certificate issuer:"emailAddress=..."
2023/07/04 08:51:17.045131 Calling C function "tls_connected()"
2023/07/04 08:51:17.045131 Calling C function "tls_read()"
2023/07/04 08:51:17.045131 Calling C function "tls_send()"
2023/07/04 08:51:17.045131 Calling C function "tls_connected()"
2023/07/04 08:51:17.045131 Calling C function "tls_read()"
2023/07/04 08:51:17.045131 received passive check request: 'service.info["MSDTC",state]' from 'x.x.x.x'
2023/07/04 08:51:17.045690 [1] processing update request (1 requests)
2023/07/04 08:51:17.045690 [1] adding new request for key: 'service.info["MSDTC",state]'
2023/07/04 08:51:17.045690 [1] created direct exporter task for plugin 'WindowsServices' itemid:0 key 'service.info["MSDTC",state]'
2023/07/04 08:51:17.045690 plugin Cpu: executing collector task
2023/07/04 08:51:17.045690 plugin WindowsPerfMon: executing collector task
2023/07/04 08:51:17.045690 executing direct exporter task for key 'service.info["MSDTC",state]'
2023/07/04 08:51:17.046235 executed direct exporter task for key 'service.info["MSDTC",state]'
2023/07/04 08:51:17.046235 sending passive check response: '0' to 'x.x.x.x'
2023/07/04 08:51:17.046235 Calling C function "tls_connected()"
2023/07/04 08:51:17.046235 Calling C function "tls_write()"
2023/07/04 08:51:17.046779 Calling C function "tls_recv()"
2023/07/04 08:51:17.046779 Calling C function "tls_recv()"
2023/07/04 08:51:17.046779 Calling C function "tls_close()"
2023/07/04 08:51:17.046779 Calling C function "tls_free()"
2023/07/04 08:51:18.049109 Calling C function "tls_new_server()"
2023/07/04 08:51:18.049109 Calling C function "tls_free()"
2023/07/04 08:51:18.049109 Calling C function "tls_ready()"
2023/07/04 08:51:18.049639 Calling C function "tls_send()"
2023/07/04 08:51:18.049639 Calling C function "tls_connected()"
2023/07/04 08:51:18.049639 Calling C function "tls_accept()"
2023/07/04 08:51:18.049639 Calling C function "tls_recv()"
2023/07/04 08:51:18.049639 Calling C function "tls_send()"
2023/07/04 08:51:18.049639 Calling C function "tls_accept()"
2023/07/04 08:51:18.051514 Calling C function "tls_recv()"
2023/07/04 08:51:18.051514 Calling C function "tls_recv()"
2023/07/04 08:51:18.053935 Calling C function "tls_send()"
2023/07/04 08:51:18.053935 Calling C function "tls_accept()"
2023/07/04 08:51:18.055056 Calling C function "tls_recv()"
2023/07/04 08:51:18.055580 Calling C function "tls_recv()"
2023/07/04 08:51:18.055624 Calling C function "tls_description()"
2023/07/04 08:51:18.055624 Calling C function "free()" 

Expected:
Constant amount of memory usage without increasing to (seemingly) infinity.



 Comments   
Comment by Alpha [ 2023 Jul 09 ]

Oooo, On debian I had the same problem! https://support.zabbix.com/browse/ZBX-23076

Comment by Karlis Salins (Inactive) [ 2023 Sep 08 ]

Hello.
The problem has been resolved in these zabbix releases:
6.0.21, 6.4.6

Generated at Fri Jan 09 00:42:07 EET 2026 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.