Page MenuHome

Changing many objects' material links between data/object causes memory leak
Closed, ArchivedPublic

Description

System Information
Operating system: Windows 10 Business, Build 19041
Graphics card: nVidia RTX 2080 Super

Blender Version
Broken: 2.9x, 3.0
Worked: (works in less complex setups)

Short description of error
I have a bit of a complicated setup and I feel this needs a bit more detailed context, sorry.
I have a blend file that acts as a library of modules (hundreds of collections). To use these modules, I usually link the main scene from the "library" into a new blend file, so I can instance any of the modules.
The modules are set up using a dummy material that needs to be changed after instancing, so I use the "Make Instances Real" command to make the underlying objects accessable. If any of these objects has a material slot linked to the data instead of the object, I have to set that slot to "object" so I can change the material just for this one object, instead of all instances in the scene (of course). I tried to take care of that in the initial library, but sometimes I miss an object or two after creating new modules.

Now, after making instances real, I end up with dozens or hundreds of individual objects that might or might not have a material slot set to "data" - so instead of going "hunting", I select all objects with the dummy material ("Select Linked Material"), hold Alt and change their material slot link to "object".

When I do this, the action goes as expected, but then Blender starts to eat up my RAM until it crashes or becomes unresponsive. Saving, restarting Blender and loading the project restores everything to normal.

The modules in the "library" file consist mostly of meshes, but there are also instances that have been linked in from another external file.

Exact steps for others to reproduce the error
I only noticed this problem appearing after I've been working with the massive module library for months and I failed to reproduce it in less complex setups. I also can't share the files involved in this setup, unfortunately, but I'll try to help anyone who wants to tackle this.

Event Timeline

Thomas Radeke (ThomasR) renamed this task from Changing many object's material links between data/object causes memory leak to Changing many objects' material links between data/object causes memory leak.Dec 22 2021, 4:55 PM
Richard Antalik (ISS) changed the task status from Needs Triage to Needs Information from User.Dec 23 2021, 7:33 AM

Not sure how to reproduce this, it sounds to me you are using some script to do this task. Can you create .blend file from scratch that can be used to reproduce this issue? Or simplify original file as much as possible so there is no confidential information?

There were some scripts involved for generating a handful of meshes and modifiers, but most were made by hand, as were all of the collections. It's months of work. :-)

I just checked - the library file is not as big as I thought (240MB), maybe I'll be able to share the project via a private channel.

You can send me data/link at richardantalik@gmail.com.

It would be helpful if you can run file blender_debug_log.cmd from folder where blender.exe is located. Then cause leak and quit blender. This will create 2 files, which should contain info about leak, so please upload them here.

Richard Antalik (ISS) closed this task as Archived.Feb 1 2022, 3:12 AM

I think I have never received any data so will close this report. If you did send them and they ended up in spam by accident, please create new report.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.
Thanks again for the report. If the problem persists please open a new report with the required information.