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. Amout of memory used by a process

Amout of memory used by a process

Scheduled Pinned Locked Moved C / C++ / MFC
questionperformance
11 Posts 4 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.
  • P Offline
    P Offline
    Prem Kumar
    wrote on last edited by
    #1

    Hi I have already made this post a while back, I am trying again. How can i get the total amount of memory used by a process at any given time? I know about GetprocessWorkingSetSize, but this works only on Winnt and not 9x systems, also this function will give only the max and min usages.

    P R J 3 Replies Last reply
    0
    • P Prem Kumar

      Hi I have already made this post a while back, I am trying again. How can i get the total amount of memory used by a process at any given time? I know about GetprocessWorkingSetSize, but this works only on Winnt and not 9x systems, also this function will give only the max and min usages.

      P Offline
      P Offline
      Philip Patrick
      wrote on last edited by
      #2

      I don't think you can know process's memory in Win95/98. Can task manager give you such information in those OS? Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer Need Web-based database administrator? You already have it!

      1 Reply Last reply
      0
      • P Prem Kumar

        Hi I have already made this post a while back, I am trying again. How can i get the total amount of memory used by a process at any given time? I know about GetprocessWorkingSetSize, but this works only on Winnt and not 9x systems, also this function will give only the max and min usages.

        R Offline
        R Offline
        Rickard Andersson20
        wrote on last edited by
        #3

        This app is a very good one.. but it's an app.. not code :( TaskInfo 2000 @ www.iarsn.com Rickard Andersson@Suza Computing ICQ#: 50302279 (Add me!) E-mail: nikado@pc.nu I'm from the winter country SWEDEN!

        J P 2 Replies Last reply
        0
        • P Prem Kumar

          Hi I have already made this post a while back, I am trying again. How can i get the total amount of memory used by a process at any given time? I know about GetprocessWorkingSetSize, but this works only on Winnt and not 9x systems, also this function will give only the max and min usages.

          J Offline
          J Offline
          Joaquin M Lopez Munoz
          wrote on last edited by
          #4

          Hi Prem. It is not easy task that you're trying to accomplish, but fortunately Keit Rule already wrote the stuff in his article Debugging & Testing Tips for Win9x (check GetHeapSize's code.) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

          P 1 Reply Last reply
          0
          • J Joaquin M Lopez Munoz

            Hi Prem. It is not easy task that you're trying to accomplish, but fortunately Keit Rule already wrote the stuff in his article Debugging & Testing Tips for Win9x (check GetHeapSize's code.) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

            P Offline
            P Offline
            Prem Kumar
            wrote on last edited by
            #5

            Hi, The Heap size is not enough for what i am trying to do. I want to get the amount of virtual memory also, In Winnt I can use the PSAPI function GetProcessMemoryInfo to get the total amout of memory a process is using. Yeah I have looked at the ToolHelp functions already(which by the way are not available in Winnt) do not give the Virtual memory usage.

            J 1 Reply Last reply
            0
            • R Rickard Andersson20

              This app is a very good one.. but it's an app.. not code :( TaskInfo 2000 @ www.iarsn.com Rickard Andersson@Suza Computing ICQ#: 50302279 (Add me!) E-mail: nikado@pc.nu I'm from the winter country SWEDEN!

              J Offline
              J Offline
              Joaquin M Lopez Munoz
              wrote on last edited by
              #6

              Are you replying to my post? The code needed is shown in full in the article itself, you don't have to download the project. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

              R 1 Reply Last reply
              0
              • P Prem Kumar

                Hi, The Heap size is not enough for what i am trying to do. I want to get the amount of virtual memory also, In Winnt I can use the PSAPI function GetProcessMemoryInfo to get the total amout of memory a process is using. Yeah I have looked at the ToolHelp functions already(which by the way are not available in Winnt) do not give the Virtual memory usage.

                J Offline
                J Offline
                Joaquin M Lopez Munoz
                wrote on last edited by
                #7

                Please correct me if I'm wrong, but I'd say heaps account for all the memory available to a process (save the memory needed for the executable code.) If you know this is not so, I'd be grateful if you could ellaborate a little more. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                P 1 Reply Last reply
                0
                • J Joaquin M Lopez Munoz

                  Are you replying to my post? The code needed is shown in full in the article itself, you don't have to download the project. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                  R Offline
                  R Offline
                  Rickard Andersson20
                  wrote on last edited by
                  #8

                  If he don't want to do it programmaticly (in fact he is :) but WTH :)) I gave a good a example of an app that can show realy much info, such memory usage etc... I'm tired and can't spell or write sentences in english that is correct enough to understan (maybe)... I need my bed now... sleep well my CP friend! Rickard Andersson@Suza Computing ICQ#: 50302279 (Add me!) E-mail: nikado@pc.nu I'm from the winter country SWEDEN!

                  J 1 Reply Last reply
                  0
                  • R Rickard Andersson20

                    This app is a very good one.. but it's an app.. not code :( TaskInfo 2000 @ www.iarsn.com Rickard Andersson@Suza Computing ICQ#: 50302279 (Add me!) E-mail: nikado@pc.nu I'm from the winter country SWEDEN!

                    P Offline
                    P Offline
                    Prem Kumar
                    wrote on last edited by
                    #9

                    There is code which you download along with the article.

                    1 Reply Last reply
                    0
                    • J Joaquin M Lopez Munoz

                      Please correct me if I'm wrong, but I'd say heaps account for all the memory available to a process (save the memory needed for the executable code.) If you know this is not so, I'd be grateful if you could ellaborate a little more. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                      P Offline
                      P Offline
                      Prem Kumar
                      wrote on last edited by
                      #10

                      Hi, I think that the Heap is not the whole memory, Functions using the the Virtual memory functions might not be listed as a part of a heap, infact some system dll's themselves are allocating using VirtualAlloc and not calling VirtualFree in some circumstances, and we want to test for it and force them to free it.

                      1 Reply Last reply
                      0
                      • R Rickard Andersson20

                        If he don't want to do it programmaticly (in fact he is :) but WTH :)) I gave a good a example of an app that can show realy much info, such memory usage etc... I'm tired and can't spell or write sentences in english that is correct enough to understan (maybe)... I need my bed now... sleep well my CP friend! Rickard Andersson@Suza Computing ICQ#: 50302279 (Add me!) E-mail: nikado@pc.nu I'm from the winter country SWEDEN!

                        J Offline
                        J Offline
                        Joaquin M Lopez Munoz
                        wrote on last edited by
                        #11

                        sleep well my CP friend! Sweet dreams :) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                        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