Space is not very far away. Aircraft on long-haul flights travel at a height of about 10 km. The lowest layer of the atmosphere, the Troposphere, ends at about 15 km. The air in the layers above the troposphere is very thin indeed. Think of a place around 15 km (9 miles) from where you are. That's pretty much how near you are to space. All the waste gases dumped into the air are mostly trapped in the thin layer of air around the Earth.