Why is Python running slow after heavy code?

Viewed 44

I am running a short but heavy code - it involves for example

v = np.array([0, 0.2, 0.4, 0.6, 0.8, 1])
A = np.meshgrid(v, v, v, v, v, v, v, v, v, v)

where A happens to have 6^10 elements, and it is used to carry out some calculations.

The code runs correctly in the console (takes around 1 minute), outputs what it should, but after that everything becomes incredibly slow. Like, in the next input even 2+2 takes around 20 seconds to be computed.

The weird fact is: even if I delete all the variables and restart the Kernel, the problem is not solved. I have to reboot my computer.

0 Answers
Related