Error of Not Freed Memory After Rendering

Sorry for bothering! I was using blender-2.83.2 & Python API to render something on Ubuntu-16.04. But always I met this error:

Error: Not freed memory blocks: xxx, total unfreed memory xxx MB

Here is my python script bpy_debug.py, like:

import bpy

# load FBX files
char_fn = "/path-to-model/sample.fbx"
anim_fn = "/path-to-anim/mixamo/sample.fbx"

bpy.ops.import_scene.fbx(filepath=char_fn, use_anim=False)
bpy.ops.import_scene.fbx(filepath=anim_fn, use_anim=True)

# link animation
char_00 = bpy.data.objects['Armature']
anim_00 = bpy.data.actions['Armature.001|mixamo.com|Layer0']
char_00.animation_data_create()
char_00.animation_data.action = anim_00

# set camera
bpy.context.scene.camera = bpy.data.objects['Camera']
bpy.data.objects['Camera'].location = (10, -12, 9)

# set scene
bpy.context.scene.frame_start = 1
bpy.context.scene.frame_end = 10
bpy.context.scene.frame_current = 1

# set scene.render
bpy.context.scene.render.image_settings.file_format = 'PNG'
bpy.context.scene.render.filepath = "./output/"
bpy.context.scene.render.fps = 30
bpy.context.scene.render.engine = 'BLENDER_EEVEE'

# render
bpy.ops.render.render(animation=True)

To figure out what happened, I used --debug flag appended, like:

./path-to-binary/blender --background --debug --python bpy_debug.py

and the output is finally:

...

Fra:9 Mem:298.37M (0.00M, Peak 308.61M) | Time:00:00.03 | Syncing Cube
Fra:9 Mem:298.38M (0.00M, Peak 308.61M) | Time:00:00.03 | Syncing Light
Fra:9 Mem:298.38M (0.00M, Peak 308.61M) | Time:00:00.03 | Syncing Camera
Fra:9 Mem:298.38M (0.00M, Peak 308.61M) | Time:00:00.03 | Syncing Armature
Fra:9 Mem:298.38M (0.00M, Peak 308.61M) | Time:00:00.03 | Syncing Eyes
Fra:9 Mem:298.50M (0.00M, Peak 308.61M) | Time:00:00.03 | Syncing Eyelashes
Fra:9 Mem:298.51M (0.00M, Peak 308.61M) | Time:00:00.03 | Syncing Body
Fra:9 Mem:299.51M (0.00M, Peak 308.61M) | Time:00:00.06 | Syncing Hair
Fra:9 Mem:299.86M (0.00M, Peak 308.61M) | Time:00:00.07 | Syncing Bottoms
Fra:9 Mem:300.21M (0.00M, Peak 308.61M) | Time:00:00.07 | Syncing Tops
Fra:9 Mem:300.55M (0.00M, Peak 308.61M) | Time:00:00.08 | Syncing Shoes
Fra:9 Mem:301.05M (0.00M, Peak 308.61M) | Time:00:00.10 | Syncing Armature.001
Fra:9 Mem:301.05M (0.00M, Peak 308.61M) | Time:00:00.10 | Rendering 1 / 64 samples
Fra:9 Mem:298.42M (0.00M, Peak 308.61M) | Time:00:00.16 | Rendering 26 / 64 samples
Fra:9 Mem:298.42M (0.00M, Peak 308.61M) | Time:00:00.19 | Rendering 51 / 64 samples
Fra:9 Mem:298.42M (0.00M, Peak 308.61M) | Time:00:00.21 | Rendering 64 / 64 samples
Fra:9 Mem:246.52M (0.00M, Peak 308.61M) | Time:00:00.27 | Sce: Scene Ve:0 Fa:0 La:0
Saved: './output/0009.png'
 Time: 00:00.50 (Saving: 00:00.23)

Fra:10 Mem:298.38M (0.00M, Peak 308.62M) | Time:00:00.03 | Syncing Cube
Fra:10 Mem:298.38M (0.00M, Peak 308.62M) | Time:00:00.03 | Syncing Light
Fra:10 Mem:298.38M (0.00M, Peak 308.62M) | Time:00:00.03 | Syncing Camera
Fra:10 Mem:298.38M (0.00M, Peak 308.62M) | Time:00:00.03 | Syncing Armature
Fra:10 Mem:298.38M (0.00M, Peak 308.62M) | Time:00:00.03 | Syncing Eyes
Fra:10 Mem:298.50M (0.00M, Peak 308.62M) | Time:00:00.03 | Syncing Eyelashes
Fra:10 Mem:298.52M (0.00M, Peak 308.62M) | Time:00:00.03 | Syncing Body
Fra:10 Mem:299.52M (0.00M, Peak 308.62M) | Time:00:00.06 | Syncing Hair
Fra:10 Mem:299.87M (0.00M, Peak 308.62M) | Time:00:00.06 | Syncing Bottoms
Fra:10 Mem:300.22M (0.00M, Peak 308.62M) | Time:00:00.07 | Syncing Tops
Fra:10 Mem:300.56M (0.00M, Peak 308.62M) | Time:00:00.08 | Syncing Shoes
Fra:10 Mem:301.06M (0.00M, Peak 308.62M) | Time:00:00.09 | Syncing Armature.001
Fra:10 Mem:301.06M (0.00M, Peak 308.62M) | Time:00:00.10 | Rendering 1 / 64 samples
Fra:10 Mem:298.43M (0.00M, Peak 308.62M) | Time:00:00.16 | Rendering 26 / 64 samples
Fra:10 Mem:298.43M (0.00M, Peak 308.62M) | Time:00:00.19 | Rendering 51 / 64 samples
Fra:10 Mem:298.43M (0.00M, Peak 308.62M) | Time:00:00.21 | Rendering 64 / 64 samples
Fra:10 Mem:246.53M (0.00M, Peak 308.62M) | Time:00:00.27 | Sce: Scene Ve:0 Fa:0 La:0
Saved: './output/0010.png'
 Time: 00:00.50 (Saving: 00:00.23)

Error: Not freed memory blocks: 25, total unfreed memory 0.010681 MB
GPUTexture len: 224 0x7f03f3ed1b38
GPUTexture len: 224 0x7f03f3ed1db8
GPUTexture len: 224 0x7f03f420c038
GPUTexture len: 224 0x7f03f420c2b8
GPUTexture len: 224 0x7f03f420c538
GPUTexture len: 224 0x7f03f420cb78
GPUTexture len: 224 0x7f03f420cdf8
GPUTexture len: 224 0x7f03f420d078
GPUTexture len: 224 0x7f03f420d2f8
GPUTexture len: 224 0x7f03f420d578
GPUTexture len: 224 0x7f03f420d938
GPUTexture len: 224 0x7f03f420dbb8
GPUTexture len: 224 0x7f03f420df78
GPUTexture len: 224 0x7f03f420e1f8
GPUTexture len: 224 0x7f03f420e5b8
GPUTexture len: 224 0x7f03f420e978
GPUTexture len: 224 0x7f03f420ebf8
GPUTexture len: 224 0x7f03f420ee78
GPUTexture len: 224 0x7f03f420f0f8
GPUTexture len: 224 0x7f03f420f378
GPUTexture len: 224 0x7f03f420f5f8
GPUTexture len: 224 0x7f03f420f878
GPUTexture len: 224 0x7f03f420faf8
GPUTexture len: 224 0x7f03f420fd78
GPUTexture len: 224 0x7f03f420fff8

Blender quit

Does somebody know how to avoid this error? Any suggestions will be appreciated! :slight_smile:

Anybody knows what happened? Many thanks!!

Could you add the two simplified fbx files for us to test ?

I’m sorry but the forum pops up a warning saying that "the file you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, gif, xml, svg, mp4, txt)." Actually all FBX files I tested were downloaded from https://www.mixamo.com/#/

https://developer.blender.org/file/upload/

Thank you!
https://developer.blender.org/F8836555
https://developer.blender.org/F8836556

I am having the same problem. Are there any python commands to clear memory? Seeing as this happens on render time I would guess that scene data piles up. When I render a few small images blender doesn’t crash but when I render a couple of FullHD images I get the same issue.

1 Like