Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    C4D Memory Usage 2

    SDK Help
    0
    3
    245
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 25/10/2004 at 13:42, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.503 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Well, now I'm miffed. 😉

      Here's the deal: I just added zlib compression to my axial vertex map plugin tag in order to reduce memory consumption. It does - by almost 500MB overall (multiple tags)! This is great!

      Oh, wait, not so great. GeFree(), using C4D's internal memory system, doesn't seem to free the memory pool for reuse. When the tags are used (Executed), the compressed memory is decompressed into GeAlloc() buffer, the action occurs, the decompressed memory is immediately FREED using GeFree().

      At this point, I get a C4D "Not Enough Memory" error doing anything else. Why? Because that 500MB is STILL there and is not reused (as should be, as was indicated by someone in the previous thread)!

      1. Do any of you actually use GeAlloc()/GeFree() instead of malloc()/free()?

      2. How does one flush freed C4D memory?

      3. If the tags are on geometry that has a Generator, will they be Executed during all cache creations in GetVirtualObjects()?

      Thanks,
      Robert

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 03/11/2004 at 11:16, xxxxxxxx wrote:

        1. Yes, I do.
        2. I don't think you can.
        3. No, I don't think so. For example, Xpresso tags on objects in an Array object are only executed once afaik.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 03/11/2004 at 12:11, xxxxxxxx wrote:

          As you have noticed, this situation has definitely come down to heap fragmentation and oh so wonderful Windows. This is why I love Java. Hate that it is interpreted and uses a VM, but love that it has automatic garbage collection and much more strongly OOP than C++. But, I've seen similar situations using Java applications under Windows, but not quite as pronounced - in other words, I think that Windows doesn't have a good heap minimization - all on the programmer (unless using HeapNN() system in VC++, I guess). Heap fragmentation only seems to be reduced by paging memory in and out (i.e.: during minimization and restoration of application window).

          One last related question, raised by C++ FAQ Lite (thanks for the link!). Arrays are EVIL! in the words of the FAQ. This is what I'm currently using for my class arrays (ala bNew class[] and bDelete()). Would it be more prudent to use std::vector instead or is C4D's approach better?

          Thanks again, Mikael,

          Robert

          1 Reply Last reply Reply Quote 0
          • First post
            Last post