Regression: Memory leak caused by speed control strip in video sequencer #97744

Closed
opened 2022-04-30 18:47:07 +02:00 by tempdevnova · 9 comments

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.07

Blender Version
Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca30557
Worked: 2.83

This broke with 47f98a38d0

Short description of error
Using an image strip in combination with the speed control strip in the video sequencer causes a memory leak in both the viewport and during render.

Exact steps for others to reproduce the error

Test file:
Memory leak.blend
When you try to render this sequence as either individual images or as a video file it will leak memory with each and every frame.
In my orginal file an image sequence worth 400 megabytes of disk space took over 8 gigabytes of ram to render.
What's worse is that when rendering larger sequences it also ignores the memory cache limit set by the user sometimes causing the entire OS to crash.
The memory also isn't freed after the render but instead stays allocated until Blender closes or more often crashes.

The behaviour in the viewport is also interesting. When you drag the frame cursor in the timeline it will cause memory to leak depending over how many frames you drag the cursor until you hit your the memory cache limit set by the user.
However Blender only leaks memory when the image sequence is actually displayed on the screen e.g. through the previewer, otherwise it appears to not leak memory (however I can't 100% confirm that it doesn't).

Thank you and have a great day!

**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.07 **Blender Version** Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: `f1cca30557` Worked: 2.83 This broke with 47f98a38d0 **Short description of error** Using an image strip in combination with the speed control strip in the video sequencer causes a memory leak in both the viewport and during render. **Exact steps for others to reproduce the error** Test file: [Memory leak.blend](https://archive.blender.org/developer/F13041932/Memory_leak.blend) When you try to render this sequence as either individual images or as a video file it will leak memory with each and every frame. In my orginal file an image sequence worth 400 megabytes of disk space took over 8 gigabytes of ram to render. What's worse is that when rendering larger sequences it also ignores the memory cache limit set by the user sometimes causing the entire OS to crash. The memory also isn't freed after the render but instead stays allocated until Blender closes or more often crashes. The behaviour in the viewport is also interesting. When you drag the frame cursor in the timeline it will cause memory to leak depending over how many frames you drag the cursor until you hit your the memory cache limit set by the user. However Blender only leaks memory when the image sequence is actually displayed on the screen e.g. through the previewer, otherwise it appears to not leak memory (however I can't 100% confirm that it doesn't). Thank you and have a great day!
Author

Added subscriber: @tempdevnova

Added subscriber: @tempdevnova
Author

Tested in Blender 3.1.2 problem still persists.

Tested in Blender 3.1.2 problem still persists.

Added subscriber: @deadpin

Added subscriber: @deadpin

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

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

Loading up the file and rendering out a smaller configuration (10% render, 10 frames) shows quite a few leaked ImBuf structures and buffers:

Error: Not freed memory blocks: 100, total unfreed memory 309.484467 MB
ImBuf_struct len: 2480 00001290368B6CB8
imb_addrectImBuf len: 8294400 000012D465DB1838
ImBuf_struct len: 2480 0000129036B080B8
imb_addrectImBuf len: 8294400 000012D461E11838
ImBuf_struct len: 2480 0000129036C9E8B8
imb_addrectImBuf len: 82944 000012B8368E0838
ImBuf_struct len: 2480 0000129036C988B8
imb_addrectImBuf len: 82944 000012B836958838
ImBuf_struct len: 2480 0000129036C928B8
imb_addrectImBuf len: 82944 000012B836A18838
ImBuf_struct len: 2480 0000129036D2ACB8
imb_addrectImBuf len: 82944 000012B836AD8838

Is out being leaked inside do_speed_effect?

  if (s->flags & SEQ_SPEED_USE_INTERPOLATION) {
    out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);  // ** Leak?
    fac = speed_effect_interpolation_ratio_get(context->scene, seq, timeline_frame);
    /* Current frame is ibuf1, next frame is ibuf2. */
    out = seq_render_effect_execute_threaded(
        &cross_effect, context, NULL, timeline_frame, fac, ibuf1, ibuf2, ibuf3);
    return out;
  }
Loading up the file and rendering out a smaller configuration (10% render, 10 frames) shows quite a few leaked ImBuf structures and buffers: ``` Error: Not freed memory blocks: 100, total unfreed memory 309.484467 MB ImBuf_struct len: 2480 00001290368B6CB8 imb_addrectImBuf len: 8294400 000012D465DB1838 ImBuf_struct len: 2480 0000129036B080B8 imb_addrectImBuf len: 8294400 000012D461E11838 ImBuf_struct len: 2480 0000129036C9E8B8 imb_addrectImBuf len: 82944 000012B8368E0838 ImBuf_struct len: 2480 0000129036C988B8 imb_addrectImBuf len: 82944 000012B836958838 ImBuf_struct len: 2480 0000129036C928B8 imb_addrectImBuf len: 82944 000012B836A18838 ImBuf_struct len: 2480 0000129036D2ACB8 imb_addrectImBuf len: 82944 000012B836AD8838 ``` Is `out` being leaked inside `do_speed_effect`? ``` if (s->flags & SEQ_SPEED_USE_INTERPOLATION) { out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3); // ** Leak? fac = speed_effect_interpolation_ratio_get(context->scene, seq, timeline_frame); /* Current frame is ibuf1, next frame is ibuf2. */ out = seq_render_effect_execute_threaded( &cross_effect, context, NULL, timeline_frame, fac, ibuf1, ibuf2, ibuf3); return out; } ```
Member

Added subscribers: @iss, @lichtwerk

Added subscribers: @iss, @lichtwerk
Member

This broke with 47f98a38d0

@iss: mind checking?

This broke with 47f98a38d0 @iss: mind checking?
Philipp Oeser changed title from Memory leak caused by speed control strip in video sequencer to Regression: Memory leak caused by speed control strip in video sequencer 2022-05-02 15:41:46 +02:00

This issue was referenced by daa9edc9be

This issue was referenced by daa9edc9be7a4837283eb46c8908c7b8eccec0c8

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Richard Antalik self-assigned this 2022-05-03 10:21:10 +02: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
5 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#97744
No description provided.