Page MenuHome

Huge memory usage when trying to paint on UVs far ouside the 0-1 range
Confirmed, NormalPublicKNOWN ISSUE

Description

Blender Version
Broken: version: 2.82a (sub 7), branch: master, commit date: 2020-03-12 05:06, hash: rB375c7dc4caf4
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.

Exact steps for others to reproduce the error

  • Open attached file
  • Try to paint the mesh

Event Timeline

Ankit Meel (ankitm) changed the task status from Needs Triage to Needs Information from User.EditedApr 1 2020, 6:25 PM

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.

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.

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.

Ankit Meel (ankitm) changed the task status from Needs Information from User to Needs Triage.Apr 1 2020, 6:32 PM
Ankit Meel (ankitm) updated the task description. (Show Details)

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 (mano-wii) renamed this task from Freeze/Memory Spike using Paint to Huge memory usage when trying to paint large portions of a texture on a mesh.Apr 3 2020, 3:39 PM
Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.
Germano Cavalcante (mano-wii) updated the task description. (Show Details)
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".Apr 3 2020, 3:44 PM

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 T68896: Texture painting usability

Philipp Oeser (lichtwerk) changed the subtype of this task from "Bug" to "Known Issue".Apr 6 2020, 1:22 PM

@Germano Cavalcante (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)

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

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:

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...

@Ankit Meel (ankitm) : not sure T75452 has the same roots... In T75452, the UVs all seem to ly inside a 0-1 range...

oh sorry, Please reopen

Philipp Oeser (lichtwerk) renamed this task 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.Apr 7 2020, 11:38 AM