Not thousands of years, merely about 600. Many lands in the Middle Ages achieved stable populations, and mechanisms to maintain stability. A priestly caste, the prohibition of charging interest, the investment of excess human capital into religious works and holidays, and sacramentalized sexuality helped stabilize both economic and population growth, despite a life expectancy near 50 years (and much older, if one survived childhood).
We all know (and even grossly exaggerate) the down sides, but few know that there were actually up sides.
Like I said, in the long run. What you described was a minor anomaly and it only impacted Europe. Global population has been mostly on the upswing for 5000 years.