I'm writing around 1200 images to video with opencv's videowriter.
When running in pycharm my ram stays at around 6gb used.
When I run exactly the same code in jupyter my ram slowly increases and by the time we are nearly at 1200 frames the ram is maxed out and sometimes the computer completely hangs.
I've tired different codecs and they all have the same effect.
I've tried deleting the VideoWriter object after the rendering is complete and the RAM usage does not clear.
I've tried garbage collection and no effect on ram.
Restarting the jupyter kernel DOES clear the RAM.
Does anyone have any experience with this or can suggest any solutions?
EDIT:
using local jupyter on ubuntu 20.04
cv2 version 4.2.0