Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    GeMemGetFreePhysicalMemoryEstimate()?

    Cinema 4D SDK
    3
    5
    848
    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.
    • R
      ResolveDZN
      last edited by

      Whenever running c4d.storage.GeMemGetFreePhysicalMemoryEstimate(), it returns 4062424101L. Forgive me if I'm overlooking the obvious, but what does this mean?

      1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand
        last edited by ferdinand

        Hi,

        although the documentation is not saying much about the format, I would assume the L is just an indicator for the number format long, i.e. an integer. The value itself is probably in bytes.

        To convert the value to a reasonable order of magnitude, you have to do the math on your own, there always two ways. Interpreting byte measurements as powers of 2 or as powers of 10 (most modern software does the latter).

        4062424101 * 10^-9 = 4.06 GB
        4062424101 / (2^10)^3 = 4062424101 / 2^30 = 3.78 GB

        Cheers
        zipit

        MAXON SDK Specialist
        developers.maxon.net

        R 1 Reply Last reply Reply Quote 0
        • R
          ResolveDZN @ferdinand
          last edited by

          @zipit said in GeMemGetFreePhysicalMemoryEstimate()?:

          To convert the value to a reasonable order of magnitude, you have to do the math on your own, there always two ways. Interpreting byte measurements as powers of 2 or as powers of 10 (most modern hardware does the latter).

          Those both were my initial thoughts, but the machine I'm using has 4GB total of memory, and there is no way that 3.78 of it is free. That's why I had thought there might've been something more at play here.

          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by

            Hi,

            why would you think that this is unreasonable? Cinema is relatively OS-agnostic, i.e. most likely has not any ties to the memory management of your OS, and will not take into account any memory consumption rather than its own. And Cinema can run on 250 MB if it is idle or only has a lightweight scene loaded. You should consider that it says estimate, which is probably MAXON's way of telling you that they know that this metric isn't that useful 😉 If you run Cinema on a workstation and only have Cinema running, the load of the OS itself becomes negligible and metric provided by the function useful.

            Cheers
            zipit

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 0
            • M
              m_adam
              last edited by

              As @zipit this is a rough quick estimation and could be wrong.

              If you want more information I suggest you use external libraries like psutil see https://stackoverflow.com/a/11615673.

              Cheers,
              Maxime

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

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