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. Memory Leak!!!

Memory Leak!!!

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestion
12 Posts 7 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 Parthi_Appu

    Hi All, Say if i'm allocating memory using 'new' operator. Without deleting the alloacated memory, my application exits. Now is it a memory leak??:confused: I hope its not.. comments please ..

    Do your Duty and Don't expect the Result

    N Offline
    N Offline
    Nibu babu thomas
    wrote on last edited by
    #3

    Parthi_Appu wrote:

    Say if i'm allocating memory using 'new' operator. Without deleting the alloacated memory, my application exits.

    It is a memory leak. Every new should be followed by a delete and every new [] should be followed by delete [].

    Parthi_Appu wrote:

    I hope its not.. comments please ..

    If only... :rolleyes:


    Nibu thomas A Developer Programming tips[^]  My site[^]

    1 Reply Last reply
    0
    • P Parthi_Appu

      Hi All, Say if i'm allocating memory using 'new' operator. Without deleting the alloacated memory, my application exits. Now is it a memory leak??:confused: I hope its not.. comments please ..

      Do your Duty and Don't expect the Result

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #4

      Parthi_Appu wrote:

      Memory Leak!!!

      Here[^]is an article that would clear most of your doubts on memory leak.

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      D T 2 Replies Last reply
      0
      • _ _AnsHUMAN_

        Parthi_Appu wrote:

        Memory Leak!!!

        Here[^]is an article that would clear most of your doubts on memory leak.

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

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

        _AnShUmAn_ wrote:

        Here[^]is an article that would clear most of your doubts on memory leak.

        In general, but nothing specific to Windows.


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        1 Reply Last reply
        0
        • P Parthi_Appu

          Hi All, Say if i'm allocating memory using 'new' operator. Without deleting the alloacated memory, my application exits. Now is it a memory leak??:confused: I hope its not.. comments please ..

          Do your Duty and Don't expect the Result

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #6

          Parthi_Appu wrote:

          Now is it a memory leak??:confused:

          yes.. try running bound checker or run you application in debug mode!

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief And you

          1 Reply Last reply
          0
          • _ _AnsHUMAN_

            Parthi_Appu wrote:

            Memory Leak!!!

            Here[^]is an article that would clear most of your doubts on memory leak.

            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #7

            _AnShUmAn_ wrote:

            Here[^]is an article that would clear most of your doubts on memory leak.

            he he he .. making use of google :) .. you are great programmer!:)

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief And you

            _ 1 Reply Last reply
            0
            • T ThatsAlok

              _AnShUmAn_ wrote:

              Here[^]is an article that would clear most of your doubts on memory leak.

              he he he .. making use of google :) .. you are great programmer!:)

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief And you

              _ Offline
              _ Offline
              _AnsHUMAN_
              wrote on last edited by
              #8

              ThatsAlok wrote:

              making use of google

              It's my say that I don't know it, I find it, and then learn it. How do you opine on this. Is it good or bad?

              Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

              T 1 Reply Last reply
              0
              • _ _AnsHUMAN_

                ThatsAlok wrote:

                making use of google

                It's my say that I don't know it, I find it, and then learn it. How do you opine on this. Is it good or bad?

                Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

                T Offline
                T Offline
                ThatsAlok
                wrote on last edited by
                #9

                _AnShUmAn_ wrote:

                It's my say that I don't know it, I find it, and then learn it. How do you opine on this. Is it good or bad?

                no doubt WikiPedia Article is nice... plus Google is only weapon apart from programming site programmer can have :)

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

                1 Reply Last reply
                0
                • T toxcct

                  it is. sometimes, the operating system can clean the memory you forgot the free, but sometimes, it won't... thus the memory leak.


                  TOXCCT >>> GEII power

                  [VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]

                  J Offline
                  J Offline
                  Jorgen Sigvardsson
                  wrote on last edited by
                  #10

                  Unaltered new operators will never leak memory after the application exits. Maybe if you've overriden a new operator to allocate shared memory or something similar.

                  -- Larva-Tested, Pupa-Approved

                  1 Reply Last reply
                  0
                  • P Parthi_Appu

                    Hi All, Say if i'm allocating memory using 'new' operator. Without deleting the alloacated memory, my application exits. Now is it a memory leak??:confused: I hope its not.. comments please ..

                    Do your Duty and Don't expect the Result

                    J Offline
                    J Offline
                    Jorgen Sigvardsson
                    wrote on last edited by
                    #11

                    Technically, it's a memory leak. Practically, it isn't. All memory allocated on the heap in a process is automatically returned when the process is terminated. A "real" memory leak's characteristics is one that grows with time, which will eventually starve the system of free memory. Assuming of course that the memory allocated isn't used after a certain point. If the app really uses and needs the memory, it doesn't qualify as a memory leak. It could mean that the application is poorly designed. If you for instance make one allocation in the application, and you don't free it, it's not a memory leak. If you continously make memory allocations in the application, without freeing them when you no longer require the memory, then you've got yourself a very real memory leak.

                    -- For proper viewing, take red pill now

                    P 1 Reply Last reply
                    0
                    • J Jorgen Sigvardsson

                      Technically, it's a memory leak. Practically, it isn't. All memory allocated on the heap in a process is automatically returned when the process is terminated. A "real" memory leak's characteristics is one that grows with time, which will eventually starve the system of free memory. Assuming of course that the memory allocated isn't used after a certain point. If the app really uses and needs the memory, it doesn't qualify as a memory leak. It could mean that the application is poorly designed. If you for instance make one allocation in the application, and you don't free it, it's not a memory leak. If you continously make memory allocations in the application, without freeing them when you no longer require the memory, then you've got yourself a very real memory leak.

                      -- For proper viewing, take red pill now

                      P Offline
                      P Offline
                      Parthi_Appu
                      wrote on last edited by
                      #12

                      Hi Jörgen, Thanx for your reply, I want to know if the memories are reclamied or not, while the application quits. Your post helped me lot. Thanx once again..

                      Do your Duty and Don't expect the Result

                      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