Free cache + memory within an objectplugin[SOLVED]



  • On 01/05/2015 at 05:42, xxxxxxxx wrote:

    Hi all,

    I´m building a forest plugin with several plant classes.
    As the result of GetVirtualObjects, instances of these classes are returned.

    I managed to start/stop the plant building but if I reactivate the generator, or the cache is used, every plant which was ever built with this generator will be returned.

    I want to free the cache and even memory space, which is filled with the instances, manually.
    Has anybody an idea how to do this?

    Thanks in advance
    Martin



  • On 02/05/2015 at 03:15, xxxxxxxx wrote:

    some progress here.

    After rewriting the main forest class and do some garbage handling(emptying lists and stuff)
    The refresh works fine.

    But the question remains still.
    Can we get full control over the generators cache, delete it and so on?

    Printing out the used memory with

      
    mem = c4d.storage.GeGetMemoryStat()[c4d.C4D_MEMORY_STAT_MEMORY_INUSE]  
    

    still shows a constant increase of memory usage.
    Do I interpret this value the wrong way?

    If not, how can I free the used memory?

    Any help would be highly appreciated.

    Best wishes
    Martin



  • On 04/05/2015 at 01:46, xxxxxxxx wrote:

    Hi Martin,

    the increasing memory usage could also be caused by the undo system. There lots of copies of caches and object generators are held. So this does not necessarily a sign, that you are leaking memory.
    In order to investigate the situation, you should run C4D in memory debug mode and watch the output after quitting Cinema 4D (you may want to start C4D from the command line for this to work).



  • On 04/05/2015 at 03:04, xxxxxxxx wrote:

    Hi Andreas,

    just decreased the undo stack amount manually inside the project settings and it was exactly as you said.
    The increasing memory usage results from the stored undo steps.
    Now that I`m thinking about it, your advice is absolutely logical, but with all these different tasks on my mind I just could not think straight.
    And now there is more homework to do figuring out the debug mode, thanks, Andreas!😉
    Seriously, I´m very thankful for this link and your hint!

    Have fun at the fmx!

    Best wishes
    Martin


Log in to reply