Note: This is my first post, so if my title is not appropriate, please let me know what an alternative could be for more relevant answers :)
I am rendering a scene for someone(so no way for me to optimize the scene or anything like that) and I'm running into an issue where blender seems to be running out of memory and becomes unresponsive.
As a countermeasure I have started using the console, and this seems to be marginally more effective, I can render about 4 frames before the subsequent render just starts hanging.
When I use the command:
blender -b "path/to/blendfile" -s 50 -e 55
I get this error response immediately:

My workaround has been to render each frame individually using this command:
blender -b "path/to/blendfile" -f 50
This has been effective for about 4 frames, after which doing frame 55, the process just hangs and I need to restart my pc to be able to do 4 more frames again.
My question is, is there a way(perhaps a command) to free up memory blocks after every 4th frame or so, to prevent the need to restart my pc each time?
Some PC & Memory Specifications: OS: Windows 10
RAM: 16GB
GPU: RTX 3070 Ti
CPU: Ryzen 5 2600x


blender -b "path/to/blendfile" -f 50currently? Are you manually invoking this from command line yourself for each frame, or did you write a small bash-or-powershell script to loop over calling Blender on each individual frame? – NeverConvex Sep 03 '21 at 10:31