The villagers where not causing any problems the day before this happened.
When the villagers are loaded the world stops responding and the memory usage starts to increase and decrease rapidly (Highest memory reached was around 27000MB). Killing all the villagers fixed the problem.
Video showing the problem https://drive.google.com/open?id=19cyQkTuLcSCLsBAFWNcx7pggKPfM0e05
I can not attach the world file as it is lager the 10MB.