Hi and welcome to the forum
For people here to help you better more data is needed. Check this post on how to provide it.
Readers probably want to know:
Since it is beneficial to have used code in RAM what do you see on your system that is a RAM leak in your case?
How did you determine that this is a leak and can you share some more info?
Removing applications such as wine or discord will not lower RAM use when not started.
For example the output of
free --human --total
would give a picture of your RAM in use on your system.