Greetings, my name is Cal and I'm here to help.

I’m a retired software engineer/developer (depending on who was paying my salary), and am currently addicted to Blender.

Recently, I posted a thread to blenderartists.org called “Blender Memory Management” where, basically, I said “I can do that!”

@claus said that I should go “git” the code and take a look.

So, here I am.

I realize that optimizing memory managment and garbage collection in an existing app is a daunting task.

Let me know if I’m stupid.

I will be looking at it from a Windows point of view.

Hope I can help,
Cal

PS - The cause of all this:

10 Likes

Hi. Just to be sure, take into account the undo system. Your first post on http://blenderartists.org seems related to that topic. There one thing that you may looking for Undo: support implicit-sharing in memfile undo step .

1 Like

OK, thanks. I’ll keep it in mind.

What I saw seemed like an unusually high jump in RAM for such a minor change. I’ve been through this exercise many times, so have some experience with it. We’ll see if I find anything…

Hi. I’m new. I did a ‘git’ of the code yesterday and have been reading and searching, mostly about memory management.

(A few other things caught my eye and distracted me from my quest, but it’s been fun.)

So…
It appears that guardedalloc and vulkan_memory_allocator are handling most of the heap memory. Is that correct?

And, (I wish I could think of a way to figure this out so I won’t seem stupid) when Blender runs, who’s in charge? Python or C/C++?

Thanks for your time, I’ll try not to be a pest.

Cal

1 Like

It appears that guardedalloc and vulkan_memory_allocator are handling most of the heap memory. Is that correct?

Partially, guardedalloc is, the vulkan backend is off by default since it’s still under heavy development so that bit of code is disabled by default, even when enabled it would only manage the memory related to the vulkan graphics stack.

And, (I wish I could think of a way to figure this out so I won’t seem stupid) when Blender runs, who’s in charge? Python or C/C++?

The main entry point of blender is in C/C++ but sometimes the main thread will call to the python library to run some python code which then will be in control for as long as that takes before giving control back.

1 Like

Oh, Thank Goodness! That code is Humongous!

I thought “well, I’ll do a find-in-files for ‘main’” (It didn’t work obviously)

OK. Thanks. I’ll keep digging, Can’t seem to stop… and loving it!

The main function lives over here.

4 Likes

OMG! (Just slammed my head with my keyboard. ) I said to my self several times “what the heck is ‘creator’ ?”

Well, now I know. Thanks.

Sorry, another follow up. What about GHOST?

Is #ifdef WITH_VULKAN_BACKEND set to false?

Or is GHOST off also?

Thanks.

What was/is vulcan meant to be?

vulkan - Vulkan - Wikipedia
ghost - Source/File Structure - Blender Developer Wiki

2 Likes

Thanks!

My eyes have stopped bleeding now. :flushed: :heart_eyes: :joy: :rofl: :upside_down_face:

I have finally stopped plowing through code and am taking the time to “Read The DANG Instructions!”

Lovin’ every minute,
Cal

1 Like

bpy.ops.render.render(animation=False, write_still=False, use_viewport=False, layer=“”, scene=“”)

I tried a few search ideas but I don’t see it.

Sorry if I’m blind or something. :expressionless:

There’s a bit of info about that here: Source/Interface/Operators - Blender Developer Wiki

The other format for that operator name is RENDER_OT_render.

1 Like

Thanks. I’m not sure that’s what I’m looking for, but we’ll see.

I want to see the code (from the python into the C/C++) starting when the user selects “Render Animation” from the “Render” menu.

Again, thanks.

Greetings,

On 6/7/2023, I ran the following command line:

C:\blender-git>git clone blender/blender: The official Blender project repository. - blender - Blender Projects

And it was good. What happens when I run it again? Will it download everything, or just the new stuff?

Thanks,
Cal

I’m gonna go ahead and combine all your questions into a single thread, it’s getting kind of out of hand here.

and why ask? why not just try it!

You can always consult the git site which has an excellent book on the usage of git

Oops… sorry. It’s just that asking others can often save a tremendous amount of time.

Cal

on that subject I’m also going to go ahead and recommend this book, which I found to be immensely helpful when starting to dive into the blender codebase. It’s a couple of years old at this point but is still very much relevant and will help you understand how the code is organized much better than the wiki does.

4 Likes

@Cal_Niemi are You planing coding here and coming something?
I see You are well with weakness recolonization in practice skills, maybe related area around GPU can be interesting for you to find bad case usages and indicate this in code. I think are issues around pointers and array refresh, reinits, shifts on memory that refreshing computing on CPU/GPU.