Help to see the logs of an ipykernel

I’m running a script using jupyter lab. However, after executing a problematic cell with a pandas dataframe of ~44MB the kernel dies after a few minutes, I suspect it might be a memory leak.

I’ve tried to look into ~/.ipython/profile_default/log but there is nothing here, and also running jupyter lab --debug doesn’t help either as the error is happening in the kernel which is not the same process as jupyter lab.

This is not happening if I run the script directly from Python or even from IPython so it’s seems it has something to do with the kernel itself.

Could you get me some pointers on how to see the logs of the dying kernel?