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. How to detect illegal memory consuming?

How to detect illegal memory consuming?

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasegraphicstoolsperformance
7 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.
  • B Offline
    B Offline
    Behzad Ebrahimi
    wrote on last edited by
    #1

    I have a multi-thread MFC application. I used Ado2 moudule by "Carlos Antollini" to act with my database. When I monitor my application by windows TaskManger, I see that "Mem Usage" & "VM Size" of my application is increasing without freeing memory until I close the application. I read most of memory management documents and I could not solve my application problem. Also I test some useful tools like "Trial DeLeaker" to detect problem. But all of memory leak tools report no memory leak! Specialty "DeLeaker" says "no GDI leak", "no Mem Leaks", "no Handle leaks". Please give me tips to find my problem. Can I find my problem by Rational Purify? I have not it. Thanks.

    C Z R B 4 Replies Last reply
    0
    • B Behzad Ebrahimi

      I have a multi-thread MFC application. I used Ado2 moudule by "Carlos Antollini" to act with my database. When I monitor my application by windows TaskManger, I see that "Mem Usage" & "VM Size" of my application is increasing without freeing memory until I close the application. I read most of memory management documents and I could not solve my application problem. Also I test some useful tools like "Trial DeLeaker" to detect problem. But all of memory leak tools report no memory leak! Specialty "DeLeaker" says "no GDI leak", "no Mem Leaks", "no Handle leaks". Please give me tips to find my problem. Can I find my problem by Rational Purify? I have not it. Thanks.

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      what happens if you minimize you program's window ?

      image processing toolkits | batch image processing

      B 1 Reply Last reply
      0
      • C Chris Losinger

        what happens if you minimize you program's window ?

        image processing toolkits | batch image processing

        B Offline
        B Offline
        Behzad Ebrahimi
        wrote on last edited by
        #3

        When I minimize my application, it frees some of "Mem Usage". But still it keeps used "VM Size". Also it keeps memory consuming when I restore it or it remains minimized. I still wait for a solution. Thanks.

        1 Reply Last reply
        0
        • B Behzad Ebrahimi

          I have a multi-thread MFC application. I used Ado2 moudule by "Carlos Antollini" to act with my database. When I monitor my application by windows TaskManger, I see that "Mem Usage" & "VM Size" of my application is increasing without freeing memory until I close the application. I read most of memory management documents and I could not solve my application problem. Also I test some useful tools like "Trial DeLeaker" to detect problem. But all of memory leak tools report no memory leak! Specialty "DeLeaker" says "no GDI leak", "no Mem Leaks", "no Handle leaks". Please give me tips to find my problem. Can I find my problem by Rational Purify? I have not it. Thanks.

          Z Offline
          Z Offline
          zhu_lin
          wrote on last edited by
          #4

          is the database server on your cp ? mybe the database. and what did your programme do when the memory increased.

          it's my pleasure to make friend with you.

          B 1 Reply Last reply
          0
          • Z zhu_lin

            is the database server on your cp ? mybe the database. and what did your programme do when the memory increased.

            it's my pleasure to make friend with you.

            B Offline
            B Offline
            Behzad Ebrahimi
            wrote on last edited by
            #5

            I used a simple access file (.mdb) in local computer. My application became slow after memory consumption!

            1 Reply Last reply
            0
            • B Behzad Ebrahimi

              I have a multi-thread MFC application. I used Ado2 moudule by "Carlos Antollini" to act with my database. When I monitor my application by windows TaskManger, I see that "Mem Usage" & "VM Size" of my application is increasing without freeing memory until I close the application. I read most of memory management documents and I could not solve my application problem. Also I test some useful tools like "Trial DeLeaker" to detect problem. But all of memory leak tools report no memory leak! Specialty "DeLeaker" says "no GDI leak", "no Mem Leaks", "no Handle leaks". Please give me tips to find my problem. Can I find my problem by Rational Purify? I have not it. Thanks.

              R Offline
              R Offline
              Roger Stoltz
              wrote on last edited by
              #6

              I've used Dan Moulding's Visual Leak Detector[^] when tracking down memory leaks. But I really recommend you to read this article[^] as chances are that you don't have a memory leak at all.

              "It's supposed to be hard, otherwise anybody could do it!" - selfquote
              "High speed never compensates for wrong direction!" - unknown

              1 Reply Last reply
              0
              • B Behzad Ebrahimi

                I have a multi-thread MFC application. I used Ado2 moudule by "Carlos Antollini" to act with my database. When I monitor my application by windows TaskManger, I see that "Mem Usage" & "VM Size" of my application is increasing without freeing memory until I close the application. I read most of memory management documents and I could not solve my application problem. Also I test some useful tools like "Trial DeLeaker" to detect problem. But all of memory leak tools report no memory leak! Specialty "DeLeaker" says "no GDI leak", "no Mem Leaks", "no Handle leaks". Please give me tips to find my problem. Can I find my problem by Rational Purify? I have not it. Thanks.

                B Offline
                B Offline
                Behzad Ebrahimi
                wrote on last edited by
                #7

                I found my problem using Easy Detection of Memory Leaks[^].

                BOOL CSmartToolTip::SetTipText(CWnd *pTipOwnerWnd, CString strTip )
                {
                TOOLINFO ti;

                \_CreateTipWnd();
                
                // Fill tool tip info structure:
                // (Set flags to indicates that the uId member is the window handle
                // to the tool, and to indicate that the ToolTip control should subclass
                // the tool's window to intercept messages.)
                ti.cbSize = sizeof(ti);						// size of this structure
                ti.uFlags = TTF\_IDISHWND | TTF\_SUBCLASS;		// flags
                ti.hwnd = pTipOwnerWnd->GetParent()->GetSafeHwnd();	// handle to the window that contains the tool
                ti.uId = (UINT)pTipOwnerWnd->GetSafeHwnd();			// application-defined identifier of the tool
                ti.hinst = AfxGetResourceHandle();				// handle to the instance that contains the string resource for the tool
                ti.lpszText = (LPTSTR)((LPCTSTR)strTip);						// pointer to the buffer that contains the text for the tool
                
                // Send add tool message and return result:
                //	return CToolTipCtrl::AddTool( pTipOwnerWnd->GetParent(), 1 );
                return((BOOL)SendMessage(TTM\_ADDTOOL, 0, (LPARAM)&ti));
                

                }

                void CSmartToolTip::_CreateTipWnd()
                {
                // We must create its once!
                if( ! IsWindow(*this) )
                {
                // Create ToolTip control
                this->Create( NULL );

                	SetTipBkColor( RGB( 255, 255, 0) );
                	SetTipTextColor( RGB( 0, 0, 0) );
                	
                	// Enable multiline
                	::SendMessage( \*this, TTM\_SETMAXTIPWIDTH, 0, 
                		(LPARAM)(INT) MAKELONG(400, 0));
                }
                

                }

                The problem located in above code. I periodically call above function in my application. But why leak? Can any one help me please?

                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