GeMemGetFreePhysicalMemoryEstimate()?



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



  • 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



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



  • 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



  • 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


Log in to reply