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. Out-Of-Memory

Out-Of-Memory

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++performancehelpquestion
16 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.
  • G Gurra_Koo

    Hi! I'm building a application in VC++ .NET. But when i run it it says to me that it's Out-Of-Memory. The memory on the computer is not full... How do you get rid of this problem? Can you give the program more memory? Regards, Koo

    A Offline
    A Offline
    Antony M Kancidrowski
    wrote on last edited by
    #3

    Is all the memory allocation on the Stack? Or are you allocating on the heap? Ant.

    G 1 Reply Last reply
    0
    • A Antony M Kancidrowski

      Is all the memory allocation on the Stack? Or are you allocating on the heap? Ant.

      G Offline
      G Offline
      Gurra_Koo
      wrote on last edited by
      #4

      I don't know. It's windows that allocate the memory so i don't have a clue...

      D A 2 Replies Last reply
      0
      • G Gurra_Koo

        I don't know. It's windows that allocate the memory so i don't have a clue...

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

        If you have Windows 2000 or XP, look at the Performance tab of Task Manager to see the machine's memory usage. What does it look like before and during the program's execution?


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        G 1 Reply Last reply
        0
        • G Gurra_Koo

          I don't know. It's windows that allocate the memory so i don't have a clue...

          A Offline
          A Offline
          Antony M Kancidrowski
          wrote on last edited by
          #6

          What I meant was are you allocation memory to data statically or dynamically. i.e.

          char data[1000000]; // Or some large numbers

          or

          char* pdata;

          pdata = new char[1000000];
          delete [] pdata;

          If you are running through the debugger you should be able to see what it is that is failing to allocate. If you look at the call stack, what is being called? Ant.

          G 1 Reply Last reply
          0
          • D David Crow

            If you have Windows 2000 or XP, look at the Performance tab of Task Manager to see the machine's memory usage. What does it look like before and during the program's execution?


            "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

            G Offline
            G Offline
            Gurra_Koo
            wrote on last edited by
            #7

            Every thing but full...

            D 1 Reply Last reply
            0
            • G Gurra_Koo

              Every thing but full...

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

              Which makes no sense. Look at the Task Manager before your program runs, write down the memory-related numbers. Look at the Task Manager while your program runs, write down the memory-related numbers. Compare those numbers. What do they tell you?


              "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

              G 1 Reply Last reply
              0
              • D David Crow

                Which makes no sense. Look at the Task Manager before your program runs, write down the memory-related numbers. Look at the Task Manager while your program runs, write down the memory-related numbers. Compare those numbers. What do they tell you?


                "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                G Offline
                G Offline
                Gurra_Koo
                wrote on last edited by
                #9

                That i've got plenty of memory left...

                D 1 Reply Last reply
                0
                • G Gurra_Koo

                  That i've got plenty of memory left...

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

                  Ok, can you post the exact verbiage of the out-of-memory message?


                  "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                  G 1 Reply Last reply
                  0
                  • D David Crow

                    Ok, can you post the exact verbiage of the out-of-memory message?


                    "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                    G Offline
                    G Offline
                    Gurra_Koo
                    wrote on last edited by
                    #11

                    It comes in a messagebox: Unhandled exception at 0x77e73887 in net32.exe: Microsoft C++ exception: CMemoryException @ 0x00f5f3a4.

                    D 1 Reply Last reply
                    0
                    • A Antony M Kancidrowski

                      What I meant was are you allocation memory to data statically or dynamically. i.e.

                      char data[1000000]; // Or some large numbers

                      or

                      char* pdata;

                      pdata = new char[1000000];
                      delete [] pdata;

                      If you are running through the debugger you should be able to see what it is that is failing to allocate. If you look at the call stack, what is being called? Ant.

                      G Offline
                      G Offline
                      Gurra_Koo
                      wrote on last edited by
                      #12

                      It's a malloc call. Trying to allocate 22 bytes..

                      D A A 3 Replies Last reply
                      0
                      • G Gurra_Koo

                        It comes in a messagebox: Unhandled exception at 0x77e73887 in net32.exe: Microsoft C++ exception: CMemoryException @ 0x00f5f3a4.

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

                        Sounds like you need to compile in debug mode, and use F5 to start the program.


                        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                        1 Reply Last reply
                        0
                        • G Gurra_Koo

                          It's a malloc call. Trying to allocate 22 bytes..

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

                          If this is a C++ program use new/delete instead.


                          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                          1 Reply Last reply
                          0
                          • G Gurra_Koo

                            It's a malloc call. Trying to allocate 22 bytes..

                            A Offline
                            A Offline
                            Antony M Kancidrowski
                            wrote on last edited by
                            #15

                            When you look at the call stack is it calling the same function over and over again? I.e. trying to allocate 22bytes over and over again? Ant.

                            1 Reply Last reply
                            0
                            • G Gurra_Koo

                              It's a malloc call. Trying to allocate 22 bytes..

                              A Offline
                              A Offline
                              antlers
                              wrote on last edited by
                              #16

                              You may have corrupted the heap. Usually this is because you've written to an uninitialized pointer, or written before/beyong the end of an array or object that you've previously allocated on the heap.

                              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