Logan's Run is a 1976 American science fiction action film directed by Michael Anderson and starring Michael York, Jenny Agutter, Richard Jordan, Roscoe Lee Browne, Farrah Fawcett, and Peter Ustinov.
It depicts a future society, on the surface a utopia, but soon revealed as a dystopia in which the population and the consumption of resources are maintained in equilibrium by killing everyone who reaches the age of 30.
I saw this as a kid. One of those weird memories where for years I wasn't sure what the hell I watched. Then I caught it a couple of decades later and it made sense. I don't think it gets the love it deserves.