It basically means you dont have enough RAM to complete the merge in pandas. Now there are few things you can try based on your code and scenario -
Enable swap if disabled and increase swap memory if you are using linux based system. Swap memory uses your SSD/HDD as RAM when usage spikes beyond RAM capacity. Linux kernel will automatically use it when your RAM exhausts. There are plenty of youtube tutorials on how to do it.
Use polars or apache pyarrow instead of pandas. Pyarrow is much efficient in terms of memory as compared to pandas and save large dataframes in chunks.
It would be good if you can give code snippets and your system config to help you in a better way.