Huge memory usage when trying to paint on UVs far ouside the 0-1 range #75284

Open
opened 2020-04-01 17:43:35 +02:00 by Matt Alan · 21 comments

Blender Version
Broken: version: 2.82a (sub 7), branch: master, commit date: 2020-03-12 05:06, hash: 375c7dc4ca
Worked: Never

Short description of error
Blender freezes when I attempt to use the paint options, after adding an image to Texture Paint. Memory will skyrocket from 150MB to 13GB and does not un-freeze.
Youtube tutorial I'm following trying to learn to paint textures, bug happens after adding the image at 2:35, and I attempt to paint the model: https://www.youtube.com/watch?v=lmbAs9jE1vI
I am very new to Blender, but pretty sure it shouldn't be doing that when attempting to use the Paint tools.

BlenderCrashReport.png

Exact steps for others to reproduce the error

  • Open attached file
  • Try to paint the mesh

texture_paint_huge_memory_usage.blend

**Blender Version** Broken: version: 2.82a (sub 7), branch: master, commit date: 2020-03-12 05:06, hash: `375c7dc4ca` Worked: Never **Short description of error** Blender freezes when I attempt to use the paint options, after adding an image to Texture Paint. Memory will skyrocket from 150MB to 13GB and does not un-freeze. Youtube tutorial I'm following trying to learn to paint textures, bug happens after adding the image at 2:35, and I attempt to paint the model: https://www.youtube.com/watch?v=lmbAs9jE1vI I am very new to Blender, but pretty sure it shouldn't be doing that when attempting to use the Paint tools. ![BlenderCrashReport.png](https://archive.blender.org/developer/F8441684/BlenderCrashReport.png) **Exact steps for others to reproduce the error** - Open attached file - Try to paint the mesh [texture_paint_huge_memory_usage.blend](https://archive.blender.org/developer/F8445952/texture_paint_huge_memory_usage.blend)
Author

Added subscriber: @Mattalan

Added subscriber: @Mattalan

#89646 was marked as duplicate of this issue

#89646 was marked as duplicate of this issue

#75452 was marked as duplicate of this issue

#75452 was marked as duplicate of this issue
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Hi Matt!
That could be a memory leak, or a result of scene with superfluous details. Please add a simple blend file to help redo the bug, with steps after which the memory increases.

Hi Matt! That could be a memory leak, or a result of scene with superfluous details. Please add a simple blend file to help redo the bug, with steps after which the memory increases.
Author

Thank you Ankit! I've attached the blend file I'm using.

From the Texture Paint screen, after creating a new image, I select Mode - Single Image, attach my Image file, and then when I attempt to paint the image, it freezes, then the memory spike happens, please see the image I've attached, where I've circled the step I take before it crashes.

image.png

In the Youtube link in my first post, it happens after the 2:35 time mark, where the Youtuber is able to paint their model, mine will crash.

BugToReproduce.blend

Thank you Ankit! I've attached the blend file I'm using. From the Texture Paint screen, after creating a new image, I select Mode - Single Image, attach my Image file, and then when I attempt to paint the image, it freezes, then the memory spike happens, please see the image I've attached, where I've circled the step I take before it crashes. ![image.png](https://archive.blender.org/developer/F8441746/image.png) In the Youtube link in my first post, it happens after the 2:35 time mark, where the Youtuber is able to paint their model, mine will crash. [BugToReproduce.blend](https://archive.blender.org/developer/F8441744/BugToReproduce.blend)
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

I had to force quit, when it exceeded 4 GB quickly. Got this in trace:

- 0	 in do_projectpaint_thread at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5336
- 1	 in BLI_task_pool_work_and_wait at blender/source/blender/blenlib/intern/task.c:937
- 2	 in project_paint_op at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5665
- 3	 in paint_proj_stroke_ps at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5765
- 4	 in paint_proj_stroke at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5806
- 5	 in paint_stroke_done at blender/source/blender/editors/sculpt_paint/paint_image.c:632
- 6	 in stroke_done at blender/source/blender/editors/sculpt_paint/paint_stroke.c:994
- 7	 in paint_stroke_modal at blender/source/blender/editors/sculpt_paint/paint_stroke.c:1448
- 8	 in wm_handler_operator_call at blender/source/blender/windowmanager/intern/wm_event_system.c:2006
- 9	 in wm_handlers_do_intern at blender/source/blender/windowmanager/intern/wm_event_system.c:2787
- 10	 in wm_handlers_do at blender/source/blender/windowmanager/intern/wm_event_system.c:2835
- 11	 in wm_event_do_handlers at blender/source/blender/windowmanager/intern/wm_event_system.c:3230
- 12	 in WM_main at blender/source/blender/windowmanager/intern/wm.c:447
- 13	 in main at blender/source/creator/creator.c:524
I had to force quit, when it exceeded 4 GB quickly. Got this in trace: ``` - 0 in do_projectpaint_thread at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5336 - 1 in BLI_task_pool_work_and_wait at blender/source/blender/blenlib/intern/task.c:937 - 2 in project_paint_op at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5665 - 3 in paint_proj_stroke_ps at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5765 - 4 in paint_proj_stroke at blender/source/blender/editors/sculpt_paint/paint_image_proj.c:5806 - 5 in paint_stroke_done at blender/source/blender/editors/sculpt_paint/paint_image.c:632 - 6 in stroke_done at blender/source/blender/editors/sculpt_paint/paint_stroke.c:994 - 7 in paint_stroke_modal at blender/source/blender/editors/sculpt_paint/paint_stroke.c:1448 - 8 in wm_handler_operator_call at blender/source/blender/windowmanager/intern/wm_event_system.c:2006 - 9 in wm_handlers_do_intern at blender/source/blender/windowmanager/intern/wm_event_system.c:2787 - 10 in wm_handlers_do at blender/source/blender/windowmanager/intern/wm_event_system.c:2835 - 11 in wm_event_do_handlers at blender/source/blender/windowmanager/intern/wm_event_system.c:3230 - 12 in WM_main at blender/source/blender/windowmanager/intern/wm.c:447 - 13 in main at blender/source/creator/creator.c:524 ```
Germano Cavalcante changed title from Freeze/Memory Spike using Paint to Huge memory usage when trying to paint large portions of a texture on a mesh 2020-04-03 15:39:54 +02:00

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

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

Added subscriber: @mano-wii

Added subscriber: @mano-wii

The code works as designed. But it is a problem to have no safeguard or warning to avoid things like that.
The UV of your object is very high and any operation is working on the entire texture at once and several times.
Edit the UV of your object before working on the texture.

Although it's not really broken, I don't think such a problem should be ignored. At least it must be a task for #68896 (Texture painting usability)

The code works as designed. But it is a problem to have no safeguard or warning to avoid things like that. The UV of your object is very high and any operation is working on the entire texture at once and several times. Edit the UV of your object before working on the texture. Although it's not really broken, I don't think such a problem should be ignored. At least it must be a task for #68896 (Texture painting usability)
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

@mano-wii: I think this should be a Known Issue then?
(feel free to change back though -- but usually out-of-memory issues are not considered bugs)

@mano-wii: I think this should be a Known Issue then? (feel free to change back though -- but usually out-of-memory issues are not considered bugs)

Added subscriber: @Gigakb

Added subscriber: @Gigakb

Most of the time, it skyrockets to 20GB+ for no reason at all. I guess its a huge memory leak.

Most of the time, it skyrockets to 20GB+ for no reason at all. I guess its a huge memory leak.
Member

Just to make this clear: we are having UVs with values like 3000 [instead of 0-1 or at least something more sensible...]
Just quickly packing UVs here make will get rid of the memory spike:
BugToReproduce_packed.blend

I havent checked code here, and of course it would be good to reduce the cost even with huge UV maps, but still think there is no reason to have UVs with these astronomic values as well...

Just to make this clear: we are having UVs with values like 3000 [instead of 0-1 or at least something more sensible...] Just quickly packing UVs here make will get rid of the memory spike: [BugToReproduce_packed.blend](https://archive.blender.org/developer/F8454373/BugToReproduce_packed.blend) I havent checked code here, and of course it would be good to reduce the cost even with huge UV maps, but still think there is no reason to have UVs with these astronomic values as well...
Member

Added subscribers: @rjg, @DirSurya

Added subscribers: @rjg, @DirSurya
Member

@ankitm : not sure #75452 has the same roots... In #75452, the UVs all seem to ly inside a 0-1 range...

@ankitm : not sure #75452 has the same roots... In #75452, the UVs all seem to ly inside a 0-1 range...
Member

oh sorry, Please reopen

oh sorry, Please reopen
Philipp Oeser changed title from Huge memory usage when trying to paint large portions of a texture on a mesh to Huge memory usage when trying to paint on UVs far ouside the 0-1 range 2020-04-07 11:38:10 +02:00
Member

Added subscribers: @RangerOri, @PratikPB2123, @EAW

Added subscribers: @RangerOri, @PratikPB2123, @EAW
Philipp Oeser removed the
Interest
Sculpt, Paint & Texture
label 2023-02-10 09:12:35 +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
6 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#75284
No description provided.