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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Memory Leak

Memory Leak

Scheduled Pinned Locked Moved C / C++ / MFC
performancetutorial
4 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.
  • T Offline
    T Offline
    Tal Rashas Guardianship
    wrote on last edited by
    #1

    Hi there, I've got a trouble of memory leak. I use Process Explorer to watch my app's status, and find that the "virtual size" keep increasing, and get to 2GB eventually, but the app never crashed. I use windbg to check the app's memory status, the memory committed and memory reserved are also good(130MB),in my understanding, the "virtual size" is composed of the memory committed and reserved,but the fact is not. Please tell me how to calculate "virtual size", Thanks very much!

    S S M 3 Replies Last reply
    0
    • T Tal Rashas Guardianship

      Hi there, I've got a trouble of memory leak. I use Process Explorer to watch my app's status, and find that the "virtual size" keep increasing, and get to 2GB eventually, but the app never crashed. I use windbg to check the app's memory status, the memory committed and memory reserved are also good(130MB),in my understanding, the "virtual size" is composed of the memory committed and reserved,but the fact is not. Please tell me how to calculate "virtual size", Thanks very much!

      S Offline
      S Offline
      Stefan_Lang
      wrote on last edited by
      #2

      This thread might shed a light or two: http://forum.sysinternals.com/virtual-memory_topic2120.html[^]

      1 Reply Last reply
      0
      • T Tal Rashas Guardianship

        Hi there, I've got a trouble of memory leak. I use Process Explorer to watch my app's status, and find that the "virtual size" keep increasing, and get to 2GB eventually, but the app never crashed. I use windbg to check the app's memory status, the memory committed and memory reserved are also good(130MB),in my understanding, the "virtual size" is composed of the memory committed and reserved,but the fact is not. Please tell me how to calculate "virtual size", Thanks very much!

        S Offline
        S Offline
        Software_Developer
        wrote on last edited by
        #3

        #include "windows.h"

        MEMORYSTATUSEX memInfo;
        memInfo.dwLength = sizeof(MEMORYSTATUSEX);
        GlobalMemoryStatusEx(&memInfo);
        DWORDLONG totalVirtualMem = memInfo.ullTotalPageFile;
        DWORDLONG virtualMemUsed = memInfo.ullTotalPageFile - memInfo.ullAvailPageFile;
        

        More on how to calculate virtual address space can be found here: http://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process[^]

        1 Reply Last reply
        0
        • T Tal Rashas Guardianship

          Hi there, I've got a trouble of memory leak. I use Process Explorer to watch my app's status, and find that the "virtual size" keep increasing, and get to 2GB eventually, but the app never crashed. I use windbg to check the app's memory status, the memory committed and memory reserved are also good(130MB),in my understanding, the "virtual size" is composed of the memory committed and reserved,but the fact is not. Please tell me how to calculate "virtual size", Thanks very much!

          M Offline
          M Offline
          Member 4416445
          wrote on last edited by
          #4

          http://technet.microsoft.com/en-us/sysinternals/dd535533[^]

          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