Kernel died in linux but not in windows

I’m working on large dataset and I currently dual booting Windows and Linux. When I execute the code in Windows, it works perfectly fine. But the kernel always died and keep restarting when executing it in Linux. Is there a reason for this problem?