iovisor / iovisor/bcc

[Memory leak] How to free memory when reading ringbuf/perfbuf data using ctypes.cast function?

Open
#4,539 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

Hello!

I am using ring buffers to communicate between TC kernel-space programs and Python user-space program. In the user-space program, I'm using `ctypes.cast` to read and handle the data sent by the kernel-space program.

I I noticed that when using this method, memory is not freed even after the callback function's return. Over time, the python program accumulates a lot of memory. Anyone have an idea on how to avoid this?

Thanks in advance,
Raouf

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the ringbuf/perfbuf callback and the ctypes.cast usage described in the issue, then reproduce the reported memory growth in a Python user-space program. Done means identifying whether the accumulation comes from the callback or binding behavior and documenting or fixing how memory is released.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, python
Domain
networking, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.