Hi, We are observing resource leak issues with librdmacm. This memory leak issue is one of those issues. You need a working IPoIB interface to run this reproducer. This reproducer will be killed as out of memory. It had been compiled with "gcc -ldl -lrdmacm -g -o fd-leak.exe fd-leak.c" Thanks ~]$ cat fd-leak.c #include <stdio.h> #include <stdlib.h> #include <dlfcn.h> #include <arpa/inet.h> #include <rdma/rdma_cma.h> #include <limits.h> #include <sys/types.h> #include <unistd.h> void test(char *ipoib_ip) { int ret; struct rdma_cm_id *id; struct sockaddr_in ipoib_addr; struct rdma_event_channel *ch; memset(&ipoib_addr, 0, sizeof(ipoib_addr)); ipoib_addr.sin_family = AF_INET; ipoib_addr.sin_port = 5555; #if 0 ret = inet_pton(AF_INET, ipoib_ip, (void *)&(ipoib_addr.sin_addr)); if (ret != 1) printf("inet_pton failed\n"); #else ipoib_addr.sin_addr.s_addr=htonl(INADDR_ANY); #endif ch = rdma_create_event_channel(); if (ch == NULL) printf("rdma_create_event_channel failed\n"); ret = rdma_create_id(ch, &id, NULL, RDMA_PS_TCP); if (ret != 0) printf("rdma_create_id failed\n"); ret = rdma_bind_addr(id, (struct sockaddr *) &ipoib_addr); if (ret != 0) printf("rdma_bind_addr failed\n"); rdma_destroy_event_channel(ch); rdma_destroy_id(id); } int main(int argc, char** argv) { int i; void *handle; pid_t pid; char path[128]; int ret; #if 0 if (argc != 2) { printf("usage: %s IPoIB_IP_ADDR\n", argv[0]); exit(-1); } #endif #define MAX INT_MAX for (i = 0; i < MAX; i++) { if (i % 1000 == 0) printf("dlopen/dlclose test: round %d\n", i); handle = dlopen("/usr/lib64/librdmacm.so", RTLD_NOW); if (!handle) { printf("dlopen failed\n"); } test(argv[1]); #if 1 ret = dlclose(handle); if (ret != 0) printf("dlclose failed\n"); #endif } #if 0 pid = getpid(); printf("pid = %d\n", pid); // for(;;); #endif return 0; }