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
    • Recent
    • Tags
    • Users
    • Login

    Possible memory leak?

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 299 Views
    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 Offline
      Helper
      last edited by

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

      On 16/01/2011 at 19:19, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.111 
      Platform:    Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Howdy,

      I'm not really sure about this, but there is something strange going on here.

      I'm developing and testing my plugin in R10.111, and my work flow is: compile, start Cinema 4D, import a file, check the result, quit Cinema 4D and then repeat several times throughout the day. But the further along I go, the longer it takes for the Mac OS file selector dialog to pop up after selecting my import command. When I first boot the computer, load Cinema 4D and select my import command the file selector dialog pops up immediately, but as the work progresses through the day it begins to delay more and more. If I reboot the machine, the file selector dialog comes up immediately again.

      The only thing I've noticed is that when I run Activity Monitor, I notice that the "Inactive" memory keeps increasing every time I start and quit Cinema 4D, and test my import command. I have the "c4d_debug.txt" file in the root directory of Cinema 4D, but it hasn't reported any memory leaks.

      Does this situation indicate a memory leak?

      I am using std::vector to keep track of the nodes imported and I'm freeing up the memory like this:

      while(nodeList.size() > 0)
      {
          delete(nodeList.back());
          nodeList.pop_back();
      }
      nodeList.clear();
      

      ... is this the proper way to free up the memory used by the std::vector? The "nodeList" is storing a list of structures that hold information about the nodes.

      Adios,
      Cactus Dan

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

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

        On 17/01/2011 at 01:49, xxxxxxxx wrote:

        Originally posted by xxxxxxxx

        <ADDRESS>
        User Information:
        Cinema 4D Version:   10.111 
        Platform:    Mac  ; 
        Mac OSX  ; 
        Language(s) :    
        C++  ;

        ---------
        </ADDRESS> Howdy,
        I'm not really sure about this, but there is something strange going on here.
        I'm developing and testing my plugin in R10.111, and my work flow is: compile, start Cinema 4D, import a file, check the result, quit Cinema 4D and then repeat several times throughout the day. But the further along I go, the longer it takes for the Mac OS file selector dialog to pop up after selecting my import command. When I first boot the computer, load Cinema 4D and select my import command the file selector dialog pops up immediately, but as the work progresses through the day it begins to delay more and more. If I reboot the machine, the file selector dialog comes up immediately again.
        The only thing I've noticed is that when I run Activity Monitor, I notice that the "Inactive" memory keeps increasing every time I start and quit Cinema 4D, and test my import command. I have the "c4d_debug.txt" file in the root directory of Cinema 4D, but it hasn't reported any memory leaks.
        Does this situation indicate a memory leak?
        [...]
        Adios,
        Cactus Dan

        A few remarks:
        - "Inactive" in the Activity Monitor indicates memory that was used before and is used now (by the OS) for caching (e.g. once you've started Cinema, it will hold a copy of Cinema in this cache and use it when starting it again - as long as the files don't change). If the OS is running low on memory, it starts pushing out old entries from this inactive memory (cache). Nothing to worry about, but something you can't control in your code (if their caching scheme makes your machine running more and more into VM, it will get slower and slower...). The best remedy I know is adding more RAM, if their caching scheme puts you constantly into VM...

        - If you quit Cinema, all memory (allocated for this process) will be released. This can't be a source of memory leaking (that slows down the file selector).

        Best regards,

        Wilfried Behne

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

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

          On 18/01/2011 at 10:55, xxxxxxxx wrote:

          Howdy,

          OK, thanks for the information.

          Well, I ran the Disk Utility on the hard drive and repaired permissions, and that seemed to help with the delay problem of the file selector dialog.

          But, in searching for what the problem was, I also discovered an obscure memory leak in my code where it wasn't freeing an array after the import command was finished. 😊

          Adios,
          Cactus Dan

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