Getting exception: Insufficient memory to continue the execution of the program

With the current version (22.3.0) of the Aspose.3D .NET library (running under .NET 6.0 on Windows, with NVIDIA card), we’re getting this exception below.

I have 64GB of RAM (and 20 cores), and 32GB+ of RAM free, so it’s not literally running out of memory.

Any ideas what could be causing this, or what a workaround may be?

Thanks,
Kirk

====

I’ve gotten this exception on a variety of scenes, which I believe used to work fine.

Insufficient memory to continue the execution of the program.
   at #=z$su2P24P2h6cI$4YAPSaLxXMkZtLWYPIIQ==.#=zat6whow=(Int32 #=zN7H42tU=)
   at #=z1mMz8qxrBBA_L4Pz5ob$4cBebYk3OwUtpnOpsyA=.#=zat6whow=(Int32 #=zN7H42tU=)
   at Aspose.ThreeD.Render.Vulkan.VkArray`1..ctor(#=zAvQHBPB4fZRQmsUZexU4wPMcvcfurjNENg== #=ztkuaZOo=, Int32 #=zN7H42tU=)
   at #=zEW3kbVXDRf9jw1FTZnh4gJG8kXcIVoWlkZ16g7o=.#=z6tdqcv6JVVB1()
   at #=zEW3kbVXDRf9jw1FTZnh4gJG8kXcIVoWlkZ16g7o=.#=zhPHNbl3RG4Ly(#=ze7fadIzGXL5CF5m$W9qOJ7vGN2wi7SZVP0AlmL0= #=z$7Ne_YQ=)
   at #=ze7fadIzGXL5CF5m$W9qOJ7vGN2wi7SZVP0AlmL0=.#=zCeTMoOQ=()
   at #=zVtO2Q96oKZFpnmEkM5kejLYlxkOXThjEDkDzl7A=.CreateRenderTexture(RenderParameters #=zuECwCnE=, Int32 #=zo3gSDu8=, Int32 #=zoKecL5Y=, Int32 #=zOZ8$NPo=)
   at Aspose.ThreeD.Scene.Render(Camera camera, Bitmap bitmap, ImageRenderOptions options)
   at Aspose.ThreeD.Scene.Render(Camera camera, String fileName, Size size, ImageFormat format, ImageRenderOptions options)
   at Unstruk.Frameworks.Knowledge.Services.GeometryHelpers.RenderScene(ILogger logger, Scene scene, ImageFormat format, Int32 width, Int32 height, String& filePath) in C:\Projects\Unstruk Data\Unstruk Knowledge PaaS\src\Unstruk.Frameworks.Knowledge.Services\GeometryHelpers.cs:line 434

With this code, where scene.Render is throwing this exception:

            var bbox = scene.RootNode.GetBoundingBox();

            var cam = new Camera(ProjectionType.Perspective)
            {
                NearPlane = 0.1,
                FarPlane = 1000,
            };

            scene.RootNode.CreateChildNode(cam).Transform.Translation = bbox.Maximum * 4;

            var center = (bbox.Maximum + bbox.Minimum) / 2;

            cam.Target = scene.RootNode;
            cam.LookAt = center;

            scene.RootNode.CreateChildNode(new Light()
            {
                LightType = LightType.Point,
                ConstantAttenuation = 0.3,
                Color = new Vector3(Color.White)
            }).Transform.Translation = new Vector3(30, 10, 10);
            
            scene.RootNode.CreateChildNode(new Light()
            {
                LightType = LightType.Directional,
                ConstantAttenuation = 0.3,
                Direction = new Vector3(-0.3, -0.4, 0.3),
                Color = new Vector3(Color.White)
            });

            scene.RootNode.CreateChildNode(new Light()
            {
                LightType = LightType.Spot,
                CastShadows = true,
                LookAt = new Vector3(28, 10, -30),
                Color = new Vector3(Color.White)
            }).Transform.Translation = new Vector3(40, 10, 50);

            var opt = new ImageRenderOptions
            {
                BackgroundColor = Color.AliceBlue,
                // Tells renderer where the it can find textures
                //opt.AssetDirectories.Add(RunExamples.GetDataDir() + "textures");
                // Turn on shadow
                EnableShadows = true
            };

            scene.Render(cam, filePath, new Size(width, height), format, opt);

@kirkmarple

Would you please also share the sample Scene file with us so that we can test the scenario in our environment and address it accordingly.

Hi Asad, I was seeing this happen across a variety of formats (.fbx, .obj, etc).

Here’s a zip of an FBX file which was one with the issue.

Thanks,
Kirk

BarramundiFish.zip (2.07 MB)

@kirkmarple

We have logged an issue as THREEDNET-1109 in our issue tracking system to further investigation this case. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.