Memory leak

I have integrated elastic apm in my python service. My service creates atleast 300 processes at startup, which are consumers for pulsar, i have observed the service is consuming to much memory. Service is under heavy load most of the time. Even when the service is idle, the memory consumption keep increasing. I have tried most of the things mentioned in documentation but nothing works. Please help