100 to 300MB memory leak per frame during EEVEE viewport render animation with cryptomatte enabled. #87764

Closed
opened 2021-04-23 23:19:29 +02:00 by michael campbell · 14 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.92

Blender Version
Broken: version: 2.93.0 Beta, 3.0 Alpha branch: master, commit date: 2021-04-22 13:23, hash: f240b5e5f7
Worked: (newest version of Blender that worked as expected)

Short description of error
If cryptomatte is enabled in the view layer properties, Blender leaks ~100MB per checkbox per frame during EEVEE viewport render animation.

Error: Not freed memory blocks: 30, total unfreed memory 3085.003662 MB
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF15140
EEVEE_cryptomatte_output_init len: 298598400 000012DD2FD31838
EEVEE_cryptomatte_output_init len: 24883200 000012DD41A01838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF1B540
EEVEE_cryptomatte_output_init len: 298598400 000012DD580D1838
EEVEE_cryptomatte_output_init len: 24883200 000012DD69DA1838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF1DD40
EEVEE_cryptomatte_output_init len: 298598400 000012DD754F1838
EEVEE_cryptomatte_output_init len: 24883200 000012DD871C1838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEE3E140
EEVEE_cryptomatte_output_init len: 298598400 000012DD8C8F1838
EEVEE_cryptomatte_output_init len: 24883200 000012DD9E5C1838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF1A140
EEVEE_cryptomatte_output_init len: 298598400 000012DDA0D61838
EEVEE_cryptomatte_output_init len: 24883200 000012DDB2A31838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF1C940
EEVEE_cryptomatte_output_init len: 298598400 000012DDB51D1838
EEVEE_cryptomatte_output_init len: 24883200 000012DDC6EA1838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEED9E140
EEVEE_cryptomatte_output_init len: 298598400 000012DDCA611838
EEVEE_cryptomatte_output_init len: 24883200 000012DDDC2E1838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEED7D40
EEVEE_cryptomatte_output_init len: 298598400 000012DDDDAA1838
EEVEE_cryptomatte_output_init len: 24883200 000012DDEF771838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF18D40
EEVEE_cryptomatte_output_init len: 298598400 000012DDF0F31838
EEVEE_cryptomatte_output_init len: 24883200 000012DE02C01838
C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF0D940
EEVEE_cryptomatte_output_init len: 298598400 000012DE043C1838
EEVEE_cryptomatte_output_init len: 24883200 000012DDC8661838
Stack trace:
blender.exe         :0x00007FF626361320  eevee_cryptomatte_download_buffer C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_cryptomatte.c:390
blender.exe         :0x00007FF626360A40  EEVEE_cryptomatte_output_accumulate C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_cryptomatte.c:430
blender.exe         :0x00007FF6263579F0  EEVEE_renderpasses_output_accumulate C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_renderpasses.c:425
blender.exe         :0x00007FF62632B030  eevee_draw_scene C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_engine.c:325
blender.exe         :0x00007FF626314F50  drw_engines_draw_scene C:\blender-git\blender\source\blender\draw\intern\draw_manager.c:1138
blender.exe         :0x00007FF626311920  DRW_draw_render_loop_ex C:\blender-git\blender\source\blender\draw\intern\draw_manager.c:1640
blender.exe         :0x00007FF626311DD0  DRW_draw_render_loop_offscreen C:\blender-git\blender\source\blender\draw\intern\draw_manager.c:1708
blender.exe         :0x00007FF626ADFF00  ED_view3d_draw_offscreen C:\blender-git\blender\source\blender\editors\space_view3d\view3d_draw.c:1719
blender.exe         :0x00007FF626AE0350  ED_view3d_draw_offscreen_imbuf C:\blender-git\blender\source\blender\editors\space_view3d\view3d_draw.c:1956
blender.exe         :0x00007FF626F158A0  screen_opengl_render_doit C:\blender-git\blender\source\blender\editors\render\render_opengl.c:371
blender.exe         :0x00007FF626F155E0  screen_opengl_render_apply C:\blender-git\blender\source\blender\editors\render\render_opengl.c:512
blender.exe         :0x00007FF626F15290  screen_opengl_render_anim_step C:\blender-git\blender\source\blender\editors\render\render_opengl.c:1186
blender.exe         :0x00007FF626F167D0  screen_opengl_render_modal C:\blender-git\blender\source\blender\editors\render\render_opengl.c:1241
blender.exe         :0x00007FF62624B480  wm_handler_operator_call C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:2084
blender.exe         :0x00007FF62624C430  wm_handlers_do_intern C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:2910
blender.exe         :0x00007FF62624BAA0  wm_handlers_do C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:2961
blender.exe         :0x00007FF626248EA0  wm_event_do_handlers C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:3381
blender.exe         :0x00007FF626234150  WM_main C:\blender-git\blender\source\blender\windowmanager\intern\wm.c:650
blender.exe         :0x00007FF625EEEE90  main C:\blender-git\blender\source\creator\creator.c:525
blender.exe         :0x00007FF62A9BD5A8  __scrt_common_main_seh D:\a01\_work\26\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
KERNEL32.DLL        :0x00007FF84A3B7020  BaseThreadInitThunk
ntdll.dll           :0x00007FF84AB42630  RtlUserThreadStart

Exact steps for others to reproduce the error
Default Scene.
Check 1 to 3 of the Cryptomatte pass boxes.
Set Viewport Shading to Rendered
View->Viewport Render Animation.

default.blend


here's the [original report's] logs

blender_debug_output.txt

blender_system_info.txt

compositor2.crash.txt

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.92 **Blender Version** Broken: version: 2.93.0 Beta, 3.0 Alpha branch: master, commit date: 2021-04-22 13:23, hash: `f240b5e5f7` Worked: (newest version of Blender that worked as expected) **Short description of error** If cryptomatte is enabled in the view layer properties, Blender leaks ~100MB per checkbox per frame during EEVEE viewport render animation. ```lines Error: Not freed memory blocks: 30, total unfreed memory 3085.003662 MB C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF15140 EEVEE_cryptomatte_output_init len: 298598400 000012DD2FD31838 EEVEE_cryptomatte_output_init len: 24883200 000012DD41A01838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF1B540 EEVEE_cryptomatte_output_init len: 298598400 000012DD580D1838 EEVEE_cryptomatte_output_init len: 24883200 000012DD69DA1838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF1DD40 EEVEE_cryptomatte_output_init len: 298598400 000012DD754F1838 EEVEE_cryptomatte_output_init len: 24883200 000012DD871C1838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEE3E140 EEVEE_cryptomatte_output_init len: 298598400 000012DD8C8F1838 EEVEE_cryptomatte_output_init len: 24883200 000012DD9E5C1838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF1A140 EEVEE_cryptomatte_output_init len: 298598400 000012DDA0D61838 EEVEE_cryptomatte_output_init len: 24883200 000012DDB2A31838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF1C940 EEVEE_cryptomatte_output_init len: 298598400 000012DDB51D1838 EEVEE_cryptomatte_output_init len: 24883200 000012DDC6EA1838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEED9E140 EEVEE_cryptomatte_output_init len: 298598400 000012DDCA611838 EEVEE_cryptomatte_output_init len: 24883200 000012DDDC2E1838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEED7D40 EEVEE_cryptomatte_output_init len: 298598400 000012DDDDAA1838 EEVEE_cryptomatte_output_init len: 24883200 000012DDEF771838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF18D40 EEVEE_cryptomatte_output_init len: 298598400 000012DDF0F31838 EEVEE_cryptomatte_output_init len: 24883200 000012DE02C01838 C:\blender-git\blender\source\blender\blenlib\BLI_array.hh:425 len: 4480 0000129EEEF0D940 EEVEE_cryptomatte_output_init len: 298598400 000012DE043C1838 EEVEE_cryptomatte_output_init len: 24883200 000012DDC8661838 ``` ```lines Stack trace: blender.exe :0x00007FF626361320 eevee_cryptomatte_download_buffer C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_cryptomatte.c:390 blender.exe :0x00007FF626360A40 EEVEE_cryptomatte_output_accumulate C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_cryptomatte.c:430 blender.exe :0x00007FF6263579F0 EEVEE_renderpasses_output_accumulate C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_renderpasses.c:425 blender.exe :0x00007FF62632B030 eevee_draw_scene C:\blender-git\blender\source\blender\draw\engines\eevee\eevee_engine.c:325 blender.exe :0x00007FF626314F50 drw_engines_draw_scene C:\blender-git\blender\source\blender\draw\intern\draw_manager.c:1138 blender.exe :0x00007FF626311920 DRW_draw_render_loop_ex C:\blender-git\blender\source\blender\draw\intern\draw_manager.c:1640 blender.exe :0x00007FF626311DD0 DRW_draw_render_loop_offscreen C:\blender-git\blender\source\blender\draw\intern\draw_manager.c:1708 blender.exe :0x00007FF626ADFF00 ED_view3d_draw_offscreen C:\blender-git\blender\source\blender\editors\space_view3d\view3d_draw.c:1719 blender.exe :0x00007FF626AE0350 ED_view3d_draw_offscreen_imbuf C:\blender-git\blender\source\blender\editors\space_view3d\view3d_draw.c:1956 blender.exe :0x00007FF626F158A0 screen_opengl_render_doit C:\blender-git\blender\source\blender\editors\render\render_opengl.c:371 blender.exe :0x00007FF626F155E0 screen_opengl_render_apply C:\blender-git\blender\source\blender\editors\render\render_opengl.c:512 blender.exe :0x00007FF626F15290 screen_opengl_render_anim_step C:\blender-git\blender\source\blender\editors\render\render_opengl.c:1186 blender.exe :0x00007FF626F167D0 screen_opengl_render_modal C:\blender-git\blender\source\blender\editors\render\render_opengl.c:1241 blender.exe :0x00007FF62624B480 wm_handler_operator_call C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:2084 blender.exe :0x00007FF62624C430 wm_handlers_do_intern C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:2910 blender.exe :0x00007FF62624BAA0 wm_handlers_do C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:2961 blender.exe :0x00007FF626248EA0 wm_event_do_handlers C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:3381 blender.exe :0x00007FF626234150 WM_main C:\blender-git\blender\source\blender\windowmanager\intern\wm.c:650 blender.exe :0x00007FF625EEEE90 main C:\blender-git\blender\source\creator\creator.c:525 blender.exe :0x00007FF62A9BD5A8 __scrt_common_main_seh D:\a01\_work\26\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 KERNEL32.DLL :0x00007FF84A3B7020 BaseThreadInitThunk ntdll.dll :0x00007FF84AB42630 RtlUserThreadStart ``` **Exact steps for others to reproduce the error** Default Scene. Check 1 to 3 of the Cryptomatte pass boxes. Set Viewport Shading to Rendered View->Viewport Render Animation. [default.blend](https://archive.blender.org/developer/F10068459/default.blend) --- here's the [original report's] logs [blender_debug_output.txt](https://archive.blender.org/developer/F10034840/blender_debug_output.txt) [blender_system_info.txt](https://archive.blender.org/developer/F10034841/blender_system_info.txt) [compositor2.crash.txt](https://archive.blender.org/developer/F10034843/compositor2.crash.txt)

Added subscriber: @3di

Added subscriber: @3di

also crashes in 3.0

also crashes in 3.0

2.92 official build also crashes

2.92 official build also crashes

also crashes when outputting as jpg sequence.

also crashes when outputting as jpg sequence.

hmm, seems to be an out of memory issue. The memory keeps rising with the frame count, I've never seen this before, it's only outputting at 1080p, after cancelling the render, the memory remains fully utilised (see small memory graph). The only way to get the memory back down is to restart blender. The scene is only at 3gb memory before viewport rendering.

image.png

image.png

hmm, seems to be an out of memory issue. The memory keeps rising with the frame count, I've never seen this before, it's only outputting at 1080p, after cancelling the render, the memory remains fully utilised (see small memory graph). The only way to get the memory back down is to restart blender. The scene is only at 3gb memory before viewport rendering. ![image.png](https://archive.blender.org/developer/F10034900/image.png) ![image.png](https://archive.blender.org/developer/F10034904/image.png)

f12 render animation remains at 3gb throughout rendering, so it only seems to be viewport animation which is suffering the problem.

f12 render animation remains at 3gb throughout rendering, so it only seems to be viewport animation which is suffering the problem.
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

The stack trace makes me wonder if its the cryptomatte buffer that just keeps getting added into ram every frame, without clearing the previous ones.

Stack trace:
blender.exe         :0x00007FF645FB3DE0  eevee_cryptomatte_download_buffer
blender.exe         :0x00007FF645FB3500  EEVEE_cryptomatte_output_accumulate
blender.exe         :0x00007FF645FAA500  EEVEE_renderpasses_output_accumulate
blender.exe         :0x00007FF645F7DBE0  eevee_draw_scene
blender.exe         :0x00007FF645F67D60  drw_engines_draw_scene
blender.exe         :0x00007FF645F646F0  DRW_draw_render_loop_ex
blender.exe         :0x00007FF645F64BA0  DRW_draw_render_loop_offscreen
blender.exe         :0x00007FF646728230  ED_view3d_draw_offscreen
blender.exe         :0x00007FF646728680  ED_view3d_draw_offscreen_imbuf
blender.exe         :0x00007FF646B8E8E0  screen_opengl_render_doit
blender.exe         :0x00007FF646B8E620  screen_opengl_render_apply
blender.exe         :0x00007FF646B8E2D0  screen_opengl_render_anim_step
blender.exe         :0x00007FF646B8F810  screen_opengl_render_modal
blender.exe         :0x00007FF645E9E5A0  wm_handler_operator_call
blender.exe         :0x00007FF645E9F550  wm_handlers_do_intern
blender.exe         :0x00007FF645E9EBC0  wm_handlers_do
blender.exe         :0x00007FF645E9BFD0  wm_event_do_handlers
blender.exe         :0x00007FF645E87530  WM_main
blender.exe         :0x00007FF645B4F020  main
blender.exe         :0x00007FF64A937F18  __scrt_common_main_seh
KERNEL32.DLL        :0x00007FF9F7AD7020  BaseThreadInitThunk
ntdll.dll           :0x00007FF9F9A02630  RtlUserThreadStart
The stack trace makes me wonder if its the cryptomatte buffer that just keeps getting added into ram every frame, without clearing the previous ones. ```lines Stack trace: blender.exe :0x00007FF645FB3DE0 eevee_cryptomatte_download_buffer blender.exe :0x00007FF645FB3500 EEVEE_cryptomatte_output_accumulate blender.exe :0x00007FF645FAA500 EEVEE_renderpasses_output_accumulate blender.exe :0x00007FF645F7DBE0 eevee_draw_scene blender.exe :0x00007FF645F67D60 drw_engines_draw_scene blender.exe :0x00007FF645F646F0 DRW_draw_render_loop_ex blender.exe :0x00007FF645F64BA0 DRW_draw_render_loop_offscreen blender.exe :0x00007FF646728230 ED_view3d_draw_offscreen blender.exe :0x00007FF646728680 ED_view3d_draw_offscreen_imbuf blender.exe :0x00007FF646B8E8E0 screen_opengl_render_doit blender.exe :0x00007FF646B8E620 screen_opengl_render_apply blender.exe :0x00007FF646B8E2D0 screen_opengl_render_anim_step blender.exe :0x00007FF646B8F810 screen_opengl_render_modal blender.exe :0x00007FF645E9E5A0 wm_handler_operator_call blender.exe :0x00007FF645E9F550 wm_handlers_do_intern blender.exe :0x00007FF645E9EBC0 wm_handlers_do blender.exe :0x00007FF645E9BFD0 wm_event_do_handlers blender.exe :0x00007FF645E87530 WM_main blender.exe :0x00007FF645B4F020 main blender.exe :0x00007FF64A937F18 __scrt_common_main_seh KERNEL32.DLL :0x00007FF9F7AD7020 BaseThreadInitThunk ntdll.dll :0x00007FF9F9A02630 RtlUserThreadStart ```
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I can reproduce using the default scene.
blender_system_info.txt

blender_debug_output.txt


Tested using:
version: 3.0.0 Alpha, branch: master, commit date: 2021-05-08 12:54, hash: 34439f05ab, type: Release
build date: 2021-05-08, 16:11:43
platform: 'Windows-10-10.0.19041-SP0'

I can reproduce using the default scene. [blender_system_info.txt](https://archive.blender.org/developer/F10068437/blender_system_info.txt) [blender_debug_output.txt](https://archive.blender.org/developer/F10068438/blender_debug_output.txt) --- Tested using: version: 3.0.0 Alpha, branch: master, commit date: 2021-05-08 12:54, hash: 34439f05ab68, type: Release build date: 2021-05-08, 16:11:43 platform: 'Windows-10-10.0.19041-SP0'
Evan Wilson changed title from EEVEE viewport render crashes every time at around frame 190. to 100 to 300MB memory leak per frame during EEVEE viewport render animation with cryptomatte enabled. 2021-05-09 08:12:59 +02:00
Jeroen Bakker self-assigned this 2021-05-09 10:19:02 +02:00
Member

Cryptomatte should not be enabled in this case. so allocations should not happen. Will check and commit a fix today.

Cryptomatte should not be enabled in this case. so allocations should not happen. Will check and commit a fix today.

This issue was referenced by 6cd4bb9435

This issue was referenced by 6cd4bb94350a9395da143fe90d9e600c0196025a

In #87764#1158555, @Jeroen-Bakker wrote:
Cryptomatte should not be enabled in this case. so allocations should not happen. Will check and commit a fix today.

Awesome! Thanks.

> In #87764#1158555, @Jeroen-Bakker wrote: > Cryptomatte should not be enabled in this case. so allocations should not happen. Will check and commit a fix today. Awesome! Thanks.
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Thomas Dinges added this to the 2.93 LTS milestone 2023-02-07 18:46:14 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#87764
No description provided.