Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Get amount of free memory

Get amount of free memory

Scheduled Pinned Locked Moved C / C++ / MFC
performancetutorial
7 Posts 3 Posters 0 Views 1 Watching
  • 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.
  • J Offline
    J Offline
    jung kreidler
    wrote on last edited by
    #1

    The task manager shows the amount of physical memory: Total Cache Available Free I would like to know how to get and/or calculate the amount of free memory, since this is not the same as reported by GlobalMemoryStatus(Ex). Regards

    D L 2 Replies Last reply
    0
    • J jung kreidler

      The task manager shows the amount of physical memory: Total Cache Available Free I would like to know how to get and/or calculate the amount of free memory, since this is not the same as reported by GlobalMemoryStatus(Ex). Regards

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      See here. You'll need to change the values for object, instance, and counter.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

      J 1 Reply Last reply
      0
      • J jung kreidler

        The task manager shows the amount of physical memory: Total Cache Available Free I would like to know how to get and/or calculate the amount of free memory, since this is not the same as reported by GlobalMemoryStatus(Ex). Regards

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        MSDN offers this[^]. :)

        Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

        J 1 Reply Last reply
        0
        • L Luc Pattyn

          MSDN offers this[^]. :)

          Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

          J Offline
          J Offline
          jung kreidler
          wrote on last edited by
          #4

          Thanks, but I already know about that: ...since this is not the same as reported by GlobalMemoryStatus(Ex).

          1 Reply Last reply
          0
          • D David Crow

            See here. You'll need to change the values for object, instance, and counter.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

            J Offline
            J Offline
            jung kreidler
            wrote on last edited by
            #5

            OK. Thanks. So far so good, but the function PdhAddCounter needs localized strings, thus in Germany you need german strings, in france you need french strings, etc. Damn, I'm not that language professional and the recently added function PdhAddEnglishCounter is not available on XP systems... (:mad: I love those guys in Redmond...). Is there a way to find out the localized corresponding language strings?

            D 1 Reply Last reply
            0
            • J jung kreidler

              OK. Thanks. So far so good, but the function PdhAddCounter needs localized strings, thus in Germany you need german strings, in france you need french strings, etc. Damn, I'm not that language professional and the recently added function PdhAddEnglishCounter is not available on XP systems... (:mad: I love those guys in Redmond...). Is there a way to find out the localized corresponding language strings?

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              If you know the index equivalent of the string you are interested in, a call to PdhLookupPerfNameByIndex() would help. See here and here for more.

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

              J 1 Reply Last reply
              0
              • D David Crow

                If you know the index equivalent of the string you are interested in, a call to PdhLookupPerfNameByIndex() would help. See here and here for more.

                "One man's wage rise is another man's price increase." - Harold Wilson

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                J Offline
                J Offline
                jung kreidler
                wrote on last edited by
                #7

                Thank you for this! :laugh: AddEnglish..., what a joke! Live's getting easier each day!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups