KX_GameObject pyattr getters leak memory #44919

Closed
opened 2015-06-02 00:31:22 +02:00 by mobious · 4 comments

System Information
Windows 8 64-bit
NVIDIA GeForce GTX 765M

Blender Version
2.74 000dfc0

Files
memoryleak.blend -- Contains an empty with a Python module setup to add and remove 1000 default cubes every frame after the space bar has been pressed. After each cube is added, its localPosition attribute it referenced (not saved).

Description
Getting certain game objects' attributes seems to cause a memory leak.

Exact steps for others to reproduce the error
In the attached file, start the game engine. Note the amount of memory currently used. Press space once to start adding objects. Note how Blender's memory usage continues to increase even though all the objects are removed and no references to the mathutils Vectors returned by referencing localPosition are saved. The increase is about 250KB/sec on my machine.
You can confirm the increase is caused by referencing the localPosition attribute by commenting out line 19 in the script and repeating the process.

Additional Notes

  • Getting an attribute many times on a single object does not leak memory. The attributes must be on new objects for memory usage to increase.
  • Setting an attribute does not cause memory to leak, as can be seen in line 23 of the script.
**System Information** Windows 8 64-bit NVIDIA GeForce GTX 765M **Blender Version** 2.74 000dfc0 **Files** [memoryleak.blend](https://archive.blender.org/developer/F183063/memoryleak.blend) -- Contains an empty with a Python module setup to add and remove 1000 default cubes every frame after the space bar has been pressed. After each cube is added, its localPosition attribute it referenced (not saved). **Description** Getting certain game objects' attributes seems to cause a memory leak. **Exact steps for others to reproduce the error** In the attached file, start the game engine. Note the amount of memory currently used. Press space once to start adding objects. Note how Blender's memory usage continues to increase even though all the objects are removed and no references to the mathutils Vectors returned by referencing localPosition are saved. The increase is about 250KB/sec on my machine. You can confirm the increase is caused by referencing the localPosition attribute by commenting out line 19 in the script and repeating the process. **Additional Notes** - Getting an attribute many times on a single object does not leak memory. The attributes must be on new objects for memory usage to increase. - Setting an attribute does not cause memory to leak, as can be seen in line 23 of the script.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @mobious

Added subscriber: @mobious

This issue was referenced by 33a7b72678

This issue was referenced by 33a7b72678221ded479935f90b81cfc99eceb08f

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
3 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#44919
No description provided.