Maniphest T71823

Merging objects that use meshes with users count of 1 increases the file size massively
Closed, Duplicate

Assigned To
Campbell Barton (campbellbarton)
Authored By
roxlu - (roxlu)
Nov 23 2019, 4:14 PM
Tags
  • BF Blender
Subscribers
Anthony Edlin (krash)
Philipp Oeser (lichtwerk)
roxlu - (roxlu)

Description

System Information
Operating system: Linux-5.3.12-arch1-1-x86_64-with-arch 64 Bits
Graphics card: GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.31

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: rB26bd5ebd42e3
Worked: (optional)

Short description of error
I'm working on a architectural model. I imported the model from Rhino 3D using Collada. The file has about 300K vertices. I'm now merging similar objects by selecting them and pressing CTRL + J. After merging some objects the file size increased from 82MB to 1.4GB. First I thought that this was caused because I was merging objects that were sharing the same mesh data, but when I iterate over the meshes and print mesh.users their value is all 1, for each mesh. I purged all ophaned data too.

As a test, I exported the .blend file to .obj.

  • The resulting .obj file was ~35MB.
  • Then I imported the file in a new .blend and saved that one, the file size of this .blend is 57MB.

I've started a discussion here too: https://blenderartists.org/t/massive-file-size-increase-after-joining-meshes-objects/1192317/4

UPDATE 1
I toggled the [x] compression box when saving and now the file is 18MB. I still think this is a bug as 300K vertices does not result in such a file size increase. Opening that file of 18MB results in ~2.6GB memory usage.
https://imgur.com/a/22hNroI

UPDATE 2
I think this is partly caused by the undo buffer somehow or at least, this issue is twofold; disabling the undo buffer allows me at least to continue working.

What can cause this increase?

Exact steps for others to reproduce the error
I'm using a private 3D model which I can't share. I'm happy to share this privately but I can't post it online.

Event Timeline

roxlu - (roxlu) created this task.Nov 23 2019, 4:14 PM
roxlu - (roxlu) updated the task description.Nov 23 2019, 4:22 PM
roxlu - (roxlu) updated the task description.Nov 23 2019, 4:48 PM
roxlu - (roxlu) updated the task description.Nov 23 2019, 5:14 PM
roxlu - (roxlu) updated the task description.Nov 23 2019, 5:23 PM
roxlu - (roxlu) updated the task description.Nov 23 2019, 5:52 PM
Anthony Edlin (krash) added a subscriber: Anthony Edlin (krash).EditedNov 23 2019, 6:22 PM

Yes if you do a series of object joins it's creating a massive undo stack, storing the data multiple times. You can do like you did and disable undo, also if you do not join them 1 by 1 but as one big group it will only be 1 undo. I don't think there is a bug here.

roxlu - (roxlu) added a comment.Nov 23 2019, 7:43 PM

Ok, good to know! The crashes were indeed most likely be caused because my PC ran out of mem. But the file size shouldn't change from 18MB to 1.25GB.

roxlu - (roxlu) added a comment.Nov 26 2019, 9:34 AM

I just noticed, a day later (?!) that when I open the file my memory goes from 18MB to 466MB which is still al lot but understandable. I removed my /tmp files and I'm not sure if blender uses shared memory, but I think something went wrong with cache files. But that's just a wild guess.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Archived.Nov 28 2019, 8:41 AM
Campbell Barton (campbellbarton) claimed this task.
Campbell Barton (campbellbarton) reopened this task as Needs Information from Developers.Apr 26 2022, 11:29 AM
Campbell Barton (campbellbarton) added a comment.Apr 26 2022, 11:45 AM

Re-opened because closing should always give a response for why.

Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).Apr 26 2022, 11:53 AM

OK, we now have T96926: Merging/joining into single object can massively increase file size which seems similar and are trying to come up with a repro case there.

So, the reason this was probably closed here is that we dont really have such a repro case, @roxlu - (roxlu) : if you can provide one, please share it in T96926 instead.
Will close this one again.