C4D Memory Usage 2



  • 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



  • 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.



  • 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


Log in to reply