Memory increase on duplicate and delete objects without limit #72853
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#72853
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux-5.3.0-24-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GT 630M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.129
Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash:
f1aa4d18d4
Worked: (optional)
Short description of error
When I have a script that runs multiple times duplicate an object increases the memory that I consider normal, but then that same script deletes the object from the scene and its orphan meshes too but the memory is not released, every time I run the script again the memory continues to increase without limit.
Exact steps for others to reproduce the error
Option 1:
Copy script in python interpreter inside blender and run it again a few times or
Option 2:
Use the addon verión of script and press buton few times.
With any of those the problem can be exprienced and seen
Script version:
https://pastebin.com/1f8QzY8z
Addon version:
https://pastebin.com/8d98PQwC
Added subscriber: @zebus3dream
Added subscriber: @juang3d
This is the script, in case it's lost from pastebin :)
I think this is rather important because we tend to use different scrpits to scatter objects, or to procedurally modify a scene, and it feels like a big memory leak.
Added subscriber: @antoniov
I have run the script in Windows using the last master code and I didn't see any memory leak running in debug mode.
Here the VS2019 memory chart:
Doesn't every time you run it increase your memory usage?
No memory leaks, I run 4 times and the memory in VS is the same....but in the bottom bar the Blender memory stat increases.
I have run in debug mode and this doesn't show any leak message and the VS memory chart keeps flat.
Then may there be a problem with the stats and not with the memory?
Not sure. I don't know how the memory stats work.
Added subscriber: @Sergey
Stats in the status bar will show amount of memory which Blender requested from the system. The system monitor (and the one in VS) will show memory which was allocated to Blender by the system.
Now, the system memory allocation might allocate more memory than is required at a specific moment and hence make subsequent allocation to happen faster.
What you can do to help investigating the issue is to run Blender with
--debug-memory
command line argument and watch output of "Memory Statistics" operator.@Sergey I have done what you said and I only see a difference:
Test 1:
Test 3:
Looking more in detail, this memory is allocated by Undo system (
writedata_do_write()
), so maybe is only the undo information.Added subscriber: @mano-wii
Changed status from 'Needs Triage' to: 'Needs User Info'
Can you see if the same happens if you reduce the amount of
undo steps
?Preferences -> System -> Undo Steps
@mano-wii You are right. If you set the undo to
0
, the memory increases in a very slow rate, .Changed status from 'Needs User Info' to: 'Archived'
@zebus3dream, thanks for the report.
This is not a bug, it's how the memory is used by the Undo system.
Your script calls
bpy.ops
within a loop, and for each call, an undo step is added.