More on dynamic loading please!

Can anyone help me regarding how exactly dynamic loading in Blender works? What happens “behind the scenes”. I mean, what the modules bge or bpy do? Or how memory allocation/deallocation happens. I need some more technical knowledge on this wonderful piece of programming!

Any help would be grateful!

Thanks

The usual way is:

loading a scene from blend
converting to BGE Scene
running the BGE scene
ending the BGE Scene
removing BGE data from memory.

As far as I know, you load meshes or scenes from a blend file while already running a BGE Scene. They loaded data is converted to BGE data. Thissi similar to loading a complete scene.

If you do not need this data anymore you can explicit remove it from memory.

The loading an converting is still single threaded. That means if you dynamically load a large amount of data the BGE freezes until it is loaded and converted. So better load multiple times small parts.

But I’m not an expert with that.