Announcement

Collapse
No announcement yet.

Refreshing/Updating Materials eating up all Ram without releasing it

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Refreshing/Updating Materials eating up all Ram without releasing it

    Dear Chaosgroup,

    next problem arrived. After getting rid of material-stuck-preview when preview set to high I had to update all my materials but that resorted into another huge problem:

    After some materials (yes they have also 8k textures) after they get updated in materialmanager the ram gets eaten up after few seconds. In my scene theres almost nothing and its only because V-Ray is rerendering the materialpreview WITHOUT releasing the Cache/Ram.
    This means: After some material CInema is stuck again lol. Which means: When using a lot of matzerials and updating them freezes C4D. You have to update them, close cinema and open it again so Ram is released. Horrible again. Oh man...

    I dont know what to say anymore. Do you need a video proof of that? Cinema is stuck after about 20 materials because then v-ray gets out of memory and caches data onto harddisc to update the materials. I have to save, close cinema and open it again and save again so I can work............

    Greets PdZ

  • #2
    https://we.tl/t-V09rYMnoLT <- VIdeoproof
    After it reaches my 60 GB Limit: Cinema is stuck, updating hangs like forever and working and rendering are impossible.
    SO to even work and render: I have to set up materials first, never change them (lol), close Cinema, reopen it THEN I can render... horrible workflow.

    Comment


    • #3
      Hi PdZ, are those classic materials or node materials. Also can you provide more information on the textures you are using - resolution, file type, how many textures you have per material?

      The improvement of the material preview performance is a priority at the moment, so we will look into this as well.
      Deyan Hadzhiev
      Developer
      chaos.com

      Comment


      • #4
        Originally posted by PdZ View Post
        https://we.tl/t-V09rYMnoLT <- VIdeoproof
        After it reaches my 60 GB Limit: Cinema is stuck, updating hangs like forever and working and rendering are impossible.
        SO to even work and render: I have to set up materials first, never change them (lol), close Cinema, reopen it THEN I can render... horrible workflow.
        Yes, I've reported the same issue. There's a memory leak present even in the MacOs.

        Check your materials assignments.

        1) Make sure you don't have 'Tile' check box in the material tag disabled
        2) Check your cloners
        a) make sure material tag is on the object itself NOT on the cloner
        b) make sure Cloner instance mode is NOT set to Render Instance
        3) take your licensing Offline, use the 'borrow' method.

        It used to be nearly impossible to operate a large scene until I did the above, now I can open the scenes w/out C4D going nuts.

        Comment


        • #5
          deyan.hadzhiev First: Iam using PBR Workflow materials. All jpgs. Some 1k mats and 8k mats. They have C4D-Layershadered Noises, Ambient Occlusionmap (Texture) on multiply, Roughnessmap (texture), Normalmap (texture) and thats it. Iam using C4D Layer to stack Ambient Occlusiontexture and noises over roughness and/Albedo-Diffusemaps.
          Nothing special.
          But just refreshing this materials blows up Ram and it gets not "cleaned" afterwards. My expectation were: "Material is rendered -> Ram is used -> If next material is rendered: delete used Ram-Cache of previous materials -> Render new material" like this. But it stacks and stacks and stacks indefinately. SO this causes Ram Overload for nothing.
          Because Materials are ALREADY rendered. So they dont have to be in the Ram anymore.

          I recognized that copying the same material over and over and over again and updating them -> Vray is intelligent and recognizes the same textures so they are stuck in ram but not stack onto each other. It only happens if you have (which is the usual case) a lot of different materials with different textures.

          imdb Second:

          1) There is no geometry in the scene, so thats not the problem
          2) see 1)
          a) see 1)
          b) see 1)
          3) dont think that has something to do with this.

          it seems just V-Ray is not releasing the material-preview-rendered textures. This is a big problem. I tested it with no objects in the scene and I just "rerendered" the materials. THey are in memory 54 Gigabyte now.
          I have to close Cinema and reopen THEN its released.

          Comment


          • #6
            deyan.hadzhiev I made a very simple test. I made 4 new V-Ray Mats. When Cinema is opened it has 1.4 Gigabyte Ram usage. Even if the materials are in the scene. BUT When rerendering these materials Ram gets blown up to 3 Gigabyte. Never gets released memory.
            WHen THEN hitting render without objects in the scene: it loses 100 MB (for some weird reason) but the "materialpreview rendered stacked Ramusage" is still used. So Ram is significantly used for absolutely NO REASON.
            This is a very very big problem because this steals gigabyte of ressources when hitting render.

            Current workaround: Do your thing in the scene. Safe the scene. Close Cinema. Reopen Cinema and the scene and THEN hit render or your memory got stolen. Or you just wait until V-Ray outsource everything to harddisc which causes more than 20x rendertime.


            There seem to be a LOT of nerdy crazy and unfortunate RAM-Problems when using V-Ray with:

            - Updating material previews
            - Using Renderinstances (which is kinda ironic)

            EDIT:
            I tested it with S24, R23 and R21

            Its ALL THE SAME. It stacks memory, not releasing it and after hitting render it loses 100MB

            Funfact: CInema 4D R21 uses A LOT LESS ressources when startet when compared to R23 and S24. (about 1 Gigabyte less memory). But the V-Ray Outcome is the same. Its stacking and stacking and stacking.
            Last edited by PdZ; 28-07-2021, 10:48 AM.

            Comment


            • #7
              Originally posted by PdZ View Post
              deyan.hadzhiev I made a very simple test. I made 4 new V-Ray Mats. When Cinema is opened it has 1.4 Gigabyte Ram usage. Even if the materials are in the scene. BUT When rerendering these materials Ram gets blown up to 3 Gigabyte. Never gets released memory.
              WHen THEN hitting render without objects in the scene: it loses 100 MB (for some weird reason) but the "materialpreview rendered stacked Ramusage" is still used. So Ram is significantly used for absolutely NO REASON.
              This is a very very big problem because this steals gigabyte of ressources when hitting render.

              Current workaround: Do your thing in the scene. Safe the scene. Close Cinema. Reopen Cinema and the scene and THEN hit render or your memory got stolen. Or you just wait until V-Ray outsource everything to harddisc which causes more than 20x rendertime.


              There seem to be a LOT of nerdy crazy and unfortunate RAM-Problems when using V-Ray with:

              - Updating material previews
              - Using Renderinstances (which is kinda ironic)
              Lol. Yes it is ironic.

              Are you by any chance using S24 version of C4D?

              Edit: Never mind, I just saw your edit above!

              Try taking your license offline, either way you cut it, online version of licensing is single threaded, so anytime the server hiccups, so does C4D. Not sure if that process is connected, worth a shot.
              Last edited by imdb; 28-07-2021, 10:51 AM.

              Comment


              • #8
                I made some other tests. It seems V-Ray IS ABSOLUTELY HOLDING THOSE TEXTURES IN THE MEMORY.

                And I think I know why this is happening. I think Chaosgroup wanted to code V-Ray very intelligently so thats the reason it takes so much time to start first rendering of a fresh scene but then it gets very fast afterwards.
                The same is happening unfortunately with the material preview. It gets hold into the memory but NOBODY WANTS THAT.

                So after refreshing the materials it takes long to refresh them but refreshing them again is very FAST. In my nerdy opinion that is because V-Ray holds thos textures into the memory for the case that you want render with them again. Seems to be a clever idea but
                is not working with material previews (V-Ray seems not do distinguish between rendering a material preview or a real rendering). This is bad.

                Also the idea of holding those textures in memory for next rendering is kinda nice but in production circumstances this is not good. Because if there are unused textures, they are still in memory and blocking the memory. It is good for animation for sure. But very very bad for stills.
                In Animation it would be a win if every frame those textures are hold in memory.

                I think 3 things have to be done:
                - disable holding textures in memory after rendering by default
                - give us an option to check if we want that (for example rerendering a scene often or having an animation)
                - disable this feature by default especially for material previews or put code that says "After Render -> Delete Texturecache out of the memory" Something like this.

                Comment


                • #9
                  deyan.hadzhiev I tested this with just 8 k Jpgs in Diffuse Slot of an V-Ray Material. Outcome is the same. But if you have all other slots set it worse of course. Here an Gif:



                  Comment


                  • #10
                    Originally posted by PdZ View Post
                    deyan.hadzhiev I tested this with just 8 k Jpgs in Diffuse Slot of an V-Ray Material. Outcome is the same. But if you have all other slots set it worse of course. Here an Gif:


                    Odd, I've tried to recreate what you're showing. Here's some very high res files set on Diffuse, Reflection, Glossiness textures. There's about 1 Gig worth of TGAs. Memory utilization is staying the same since opening Cinema 4D w/out any scenes loaded. Re-rendering materials over and over is much quicker than what your GIF is showing and Memory isn't going up.

                    Click image for larger version

Name:	Screen Shot 2021-07-28 at 2.42.54 PM.png
Views:	793
Size:	683.5 KB
ID:	1120696

                    Comment


                    • #11
                      Same here, I’m not experiencing those memory leaks (I’m on MacOS too but I can test this in Windows when I have time). I use tons of 4K/8K images without memory issues, even using 32GB systems, the only hiccups I get when using Vray materials is when I use the Vray layered shader but since I’m aware of this I tend to use the standard C4D layer shader unless the layered is strictly needed. I’m not sure if it can make a difference but I’m using mostly tiff file.
                      There’s no way developers coded intentionally Vray to keep all the assets loaded on RAM all the time just to speedup the render start, it must be something else
                      3D Scenes, Shaders and Courses for V-ray and Corona
                      NEW V-Ray 5 Metal Shader Bundle (C4D/Max): https://www.3dtutorialandbeyond.com/...ders-cinema4d/
                      www.3dtutorialandbeyond.com
                      @3drenderandbeyond on social media @3DRnB Twitter

                      Comment


                      • #12
                        Originally posted by sirio76 View Post
                        Same here, I’m not experiencing those memory leaks (I’m on MacOS too but I can test this in Windows when I have time). I use tons of 4K/8K images without memory issues, even using 32GB systems, the only hiccups I get when using Vray materials is when I use the Vray layered shader but since I’m aware of this I tend to use the standard C4D layer shader unless the layered is strictly needed. I’m not sure if it can make a difference but I’m using mostly tiff file.
                        There’s no way developers coded intentionally Vray to keep all the assets loaded on RAM all the time just to speedup the render start, it must be something else
                        Yes, it is.

                        Are you using offline license or online (default)?

                        Comment


                        • #13
                          Guys. As I said: Ram is going up ONCE and STAYS high. I didnt say that it stacks if you reload them. It stacks once and stays in Ram and every new rendered texture will be loaded in the Ram and doesnt get released.

                          Pls read exactly what I wrote.

                          Comment


                          • #14
                            For the record: EVERY NEW TEXTURE. The textures which are already material preview rendered seem to stay in Ram forever and blocking the whole System. If you load a scene with for ex. 20 Materials which have 5 textures 8k each. When you rerender them in the material manager the Ram gets blown up and Ram will be full until you close Cinema.

                            Do you understand the problem here?

                            Comment


                            • #15
                              imdb and @sirio: The thing is, if you have a scene with 100 materials the were already previewrendered and you save the file, close cinema and reopen it: Ram is low. BUT Rerender them and look what Ram is doing then.

                              So for example what I did yesterday. I had to change one setting in all materials which leads to automatically reloading them all lead to frozen Cinema because Ram was full and Vray uses HDD instead which is slow as hell.

                              This is a big problem. Of course you can circumvent this by doing what I wrote before. You render 10-20 mats, save the scene, close cinema, reload cinema and the scene, render next 10-20 mats and do it over and over again until its done. Then the problem is done. But what kinda workflow is that? Thats crazy. Hope I described it now very understandable!!

                              Comment

                              Working...
                              X