For people who have been having this issue lately I can share a quick fix that seems to have worked on my Realm (for now at least). I haven't experienced crashes in a while now and it seems the cause of all the problems were villagers in my town. I set up a little shop in which villagers were trapped behind fences, were not given beds and their range of movement was quite small as the space in which they were trapped was not that large.
My quick fix goes as follows:
Free the villagers from any entrapment they may be in, give them a good amount of space to roam in. You can still close them in a house or building, just let them stretch their legs a bit.
Put down one bed for each villager. The bed must be accessible for each one of them and easy to reach.
Put down a job-site block for each villager corresponding to their current job. If they do not have a job, assign them one. The job-site block must be close to the villager and accessible/easy to reach, just like the beds. (If you do not know much about villager job-site blocks you can easily google it and have a look at the wiki)
As a quick recap, at the end of all the steps you should have villagers that go to bed at night and to the job-site block during the day without any obstacle.
Keep in mind that if other beds or job-site blocks are near the villagers, they may try to go to those ones instead of the newly placed ones, so to be sure I removed all beds and job-site blocks that may have interfered with the new ones I just placed for the villagers.
If all of those steps don't work, you can try the nuclear option and just "remove" all the villagers near your town/house and see if the problem is solved. (I recommend backing up your world first, you never know).
Hope this works out for other people as it seems it worked for me!
For people who have been having this issue lately I can share a quick fix that seems to have worked on my Realm (for now at least).
I haven't experienced crashes in a while now and it seems the cause of all the problems were villagers in my town.
I set up a little shop in which villagers were trapped behind fences, were not given beds and their range of movement was quite small as the space in which they were trapped was not that large.
My quick fix goes as follows:
Free the villagers from any entrapment they may be in, give them a good amount of space to roam in. You can still close them in a house or building, just let them stretch their legs a bit.
Put down one bed for each villager. The bed must be accessible for each one of them and easy to reach.
Put down a job-site block for each villager corresponding to their current job. If they do not have a job, assign them one. The job-site block must be close to the villager and accessible/easy to reach, just like the beds. (If you do not know much about villager job-site blocks you can easily google it and have a look at the wiki)
As a quick recap, at the end of all the steps you should have villagers that go to bed at night and to the job-site block during the day without any obstacle.
Keep in mind that if other beds or job-site blocks are near the villagers, they may try to go to those ones instead of the newly placed ones, so to be sure I removed all beds and job-site blocks that may have interfered with the new ones I just placed for the villagers.
If all of those steps don't work, you can try the nuclear option and just "remove" all the villagers near your town/house and see if the problem is solved. (I recommend backing up your world first, you never know).
Hope this works out for other people as it seems it worked for me!