Number of workers vs Memory consumption

Hello, I would like to know if there is a direct dependency between the number of workers I'm using in logstash and the memory consumption.
I have changed from 1 worker to 50 workers with a little change in memory consumption.
I'm using top | grep java to see the memory consumption of the PID

I have noticed there is an increase in CPU usage, which makes sense, but what about memory?

Thank you very much

That'll depend on what inputs, filters and outputs you use.

In my case I'm using 2 inputs (udp and gelf), for the filters I'm using grok and grep and for the output I have elasticsearch and redis.