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. Need some help

Need some help

Scheduled Pinned Locked Moved C / C++ / MFC
performancehelpquestion
5 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
    Brian V Shifrin
    wrote on last edited by
    #1

    My application "uses" tons of memory. And yes, all of it get's deallocated when program exits. What I would like to do is to find out where all allocation goes too... Application has 100's of classes. Memory allocated by "new" Brian #define new new(_T(_FILE_), _T(_LINE_)) Anyone has class that agregate line above?

    C D 2 Replies Last reply
    0
    • B Brian V Shifrin

      My application "uses" tons of memory. And yes, all of it get's deallocated when program exits. What I would like to do is to find out where all allocation goes too... Application has 100's of classes. Memory allocated by "new" Brian #define new new(_T(_FILE_), _T(_LINE_)) Anyone has class that agregate line above?

      C Offline
      C Offline
      Carlos Antollini
      wrote on last edited by
      #2

      you need to use delete for every variable that you had allocated with new Cheers!!!!:) Carlos Antollini.

      B 1 Reply Last reply
      0
      • C Carlos Antollini

        you need to use delete for every variable that you had allocated with new Cheers!!!!:) Carlos Antollini.

        B Offline
        B Offline
        Brian V Shifrin
        wrote on last edited by
        #3

        I am not a newbie. No I don't any leaks. I am looking for a way to optimize structures to reduce memry overhead. what does "delete" has to do with this? Brian

        R 1 Reply Last reply
        0
        • B Brian V Shifrin

          I am not a newbie. No I don't any leaks. I am looking for a way to optimize structures to reduce memry overhead. what does "delete" has to do with this? Brian

          R Offline
          R Offline
          realJSOP
          wrote on last edited by
          #4

          Wow, that was rude. The only thing you can do is delete the pointers as soon as you don't need them any more, but then, you take a chance on fragmenting memory. Other than that, we really can't help you much without seeing the code and analyzing your structures.

          1 Reply Last reply
          0
          • B Brian V Shifrin

            My application "uses" tons of memory. And yes, all of it get's deallocated when program exits. What I would like to do is to find out where all allocation goes too... Application has 100's of classes. Memory allocated by "new" Brian #define new new(_T(_FILE_), _T(_LINE_)) Anyone has class that agregate line above?

            D Offline
            D Offline
            Derek Waters
            wrote on last edited by
            #5

            OK, if I understand your question, you're saying that you don't have memory leaks, but you want to know which functions are allocating (and deleting) lots of memory, and which aren't so that you know which ones to optimise? I'm not sure about your redefinition of new, but you could always try profiling your code, and find out how often the constructors of your various classes get called. That should give you some idea of where the most memory is being allocated. Have a look at "profiling" in MSDN for more info. Hope this helps. ------------------------ Derek Waters derek@lj-oz.com

            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