Cinema 4D Memory Usage



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

    On 23/10/2004 at 20:25, xxxxxxxx wrote:

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

    ---------
    There is something odd about C4D (R8.5 anyway). When I run C4D, TaskManager notes a memory usage of approx. 99MB which stays at about that amount for the rest of a session. That is, unless I minimize C4D (which drops to 2MB in this state) and restore it. Then, its memory usage drops to approx. 16MB.

    At first, I thought it may be related to my plugin whose dialog is restored from the Layout, but these values did not change significantly if I saved the default Layout with my plugin dialog not running or by removing my plugin altogether.

    What was that other ~83MB such that it could be removed only by minimize/restore?

    Is this a symptom of Windows XP or Cinema4D?

    I'm asking because my plugin requires vast wastelands of memory to be available for some of the more demanding processing and loaded objects. Currently in the process of greatly reducing as much memory usage as possible in my plugin and the resulting plugin tags/objects, but this other issue is not my doing. That is prime realestate!

    Thanks,
    Robert



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

    On 24/10/2004 at 08:42, xxxxxxxx wrote:

    I don't know the Windows XP internals at all, but it would be necessary to know, what task manager lists as "memory usage", physical or virtual memory usage. If it is physical memory (aka RSS - resident set size), this effect can be explained: The 99MB is the complete size of all loaded plugins and their data. But when you minimize C4D, the Windows pager might decide to throw out unused pages, reducing the size to the 2MB that were recently used. This would be the core parts of C4D only. When you restore the C4D window, additional parts of the C4D code are needed to restore the layout and the scenery, so code for the plugins and associated working sets are being readded to the resident set, either by reloading them from disk or from swap or by lazy copying from the Windows buffer cache.

    In general, the rule amongst OS designers is: empty memory is bad memory, simply because it is unused. You can always use otherwise empty memory to cache disk content. This memory would not be empty in the common sense, but can be reused immediately, should the need arise. This is why the usefulness of memory usage indicators is limited.

    Michael



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

    On 24/10/2004 at 11:31, xxxxxxxx wrote:

    Task Manager lists both, including Commit Charge, overall, but the memory listed per process appears to be physical memory - and of course limited to the 2GB Windows barrier. This is where PhotoShop, After Effects, and Premiere Pro have advantages in using their own disk-based cache system when working with extremely large files.

    What you describe makes sense, but it does make me wonder if that unused page memory is reclaimed as needed (without minimalization to trigger) by other activities such as when my plugin loads a file which creates large temporary and permanent storage. The thing that worries me is that I cannot manage C4D's or Windows' memory usage, only my plugin's. Unlike COFFEE or Java, there doesn't seem a way to trigger a 'garbage collection'. Due to the transient memory requirements in some cases, like when loading large numbers of morphs, it may be necessary to find a way to do this.

    Thanks for the information. Hopefully the process of reducing memory usage for my plugin will help resolve this to some extent. I've already dropped about 4-5MB of Dialog 'bloat' for folder/file listings and am implementing more compact ways of storing information (including bit masks for bools and possibly compressing weights and morphs).

    Robert



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

    On 24/10/2004 at 12:07, xxxxxxxx wrote:

    Quote: Originally posted by kuroyume0161 on 24 October 2004
    >
    > * * *
    >
    > What you describe makes sense, but it does make me wonder if that unused page memory is reclaimed as needed (without minimalization to trigger) by other activities such as when my plugin loads a file which creates large temporary and permanent storage.
    >
    >
    > * * *

    I would expect that to happen in a decent operating system. AFAIK Windows uses a working set algorithm in memory management, most likely LRU-based, so memory required by your plugin will supersede less actively used memory by from other parts of C4D or Windows.

    But if 2GB is not enough, your only options are switching to a OS with a 3GB user space (like Linux) or even better: buying an AMD64 or EM64T machine...

    Michael


Log in to reply