pipewire-jack seems to be causing a memory leak
18:22 03 Sep 2026
pipewire version: 1.6.8
wireplumber version: 0.5.7
pipewire-jack version: 1.6.8
gcc version: 16.2.1
linux kernel version: 7.2.2
distro: arch linux

I was trying to make an application that uses jack, but i kept getting a memory leak and the leak seems to be coming from pipewire.
I'm only linking jack, but since my system uses pipewire it seems that using jack invokes pipewire in some way.

I made a simple test program that just opens and closes a jack client:

#include 
#include 

int main(void){

  jack_status_t status;
  jack_client_t* client =
    jack_client_open("test-client", JackNoStartServer, &status);

  if(client ==NULL){
    fprintf(stderr, "open failed, 0x%x\n", status);
    return -1;
  }

  if(jack_client_close(client)!=0){
    fprintf(stderr, "close failed\n");
    return 1;
  }
  
  return 0;
}

This still does get a memory leak, i'm testing with asan and valgrind, here's their output:

asan log

valgrind log

And i made another test program that opens and closes a jack client many times to see if the allocations grew, and they did.

Here's the program:

#include 
#include 

int main(void){
  for(int i=0; i<1000; i++){
    jack_status_t status;
    
    jack_client_t* client =
      jack_client_open("test-client", JackNoStartServer, &status);

    if(client == NULL){
      fprintf(stderr, "open failed at iteration %i, [0x%x]\n", i, status);
      return -1;
    }

    if(jack_client_close(client)!=0){
      fprintf(stderr, "close failed at iteration %i\n", i);
      return -1;
    }
  }

  return 0;
}

Here's the asan log

And the valgrind log (i killed the program out of fear it would crash my computer)

I monitored the iterations version with htop while it ran, and the amount of RES memory kept growing.

This is the Makefile i'm using to compile everything, might be relevant i don't know:

simple-noasan:
    gcc simple.c -o simple -l jack

iterations-noasan:
    gcc iterations.c -o iterations -l jack

simple:
    gcc simple.c -o simple -l jack -fsanitize=address

iterations:
    gcc iterations.c -o iterations -l jack -fsanitize=address

I tried running it with pw-jack but that doesn't change it at all.

I also tried updating the libraries (full system update), everything is up to date and this is still happening, wireplumber did update between yesterday (when i noticed this issue) and today, but it didn't fix it. I am pretty sure that the issue is in the libraries my program loads and not with my program itself. I had someone on discord try to replicate the error on their computer and the result was the same.

I could try using native jack instead of pipewire-jack but i'd rather noti mean pipewire SHOULDN'T cause a memory leak right??

c memory-leaks jack pipewire