Where is my ram going?

I finaly found out why my phone is so laggy (im dumb)

I have those trash can app that cleans my cackhe, and it says 1,6gt is free. I have 4 gt ram

And the trash can app tells what apps takes the 1,6gt. How i stop apps taking my ram?

I know im asking about phone, but i bet this happens to all software too!