Skip to content

Memory leak issue when running with systemd n send to kafka partition with key #423

@shasha047

Description

@shasha047

Describe the bug

  1. Memory Leak
  2. kafka partition key coming as 8�(� in kafka
  3. few warning coming => Sep 06 13:36:01 ccs-122 goflow2[3961852]: time=2025-09-06T13:36:01.765Z level=WARN msg="template error" scheme=netflow hostname="" port=8057 count=1 workers=2 blocking=false queue_size=1000000

** Configs **
Systemd config

[Unit]
Description=GoFlow2 NetFlow Collector on port 8057
After=network.target

[Service]
ExecStart=/opt/netflow/bin/goflow2
-mapping=/opt/netflow/config/mapping_8057.yaml
-transport=kafka
-transport.kafka.brokers=10.10.10.122:9093
-transport.kafka.topic=netflow
-transport.kafka.hashing
-listen=netflow://:8057
-addr=:18057

WorkingDirectory=/opt/netflow
Restart=always
RestartSec=5
User=root
Group=root
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

cat /opt/netflow/config/mapping_8057.yaml

formatter:
type: json
key:
- sampler_address

mapping:

  • output: sampler_address
    value: "$sampler_address"

To Reproduce
Steps to reproduce the behavior:

  1. Run systemd service with systemctl commands
  2. run traffic using tcp replay or actual router via some other machine
  3. check : systemd-cgtop => memory keep growing

Expected behavior
A clear and concise description of what you expected to happen.

  1. kafka patition key should be correct
  2. no memory leak

GoFlow2:

  • Version: latest: v2.2.3
  • Environment: systemd
  • OS: Ubuntu 22.04 jammy

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions