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. Unauthorized memory allocation - Possible VC2005 bug? [modified]

Unauthorized memory allocation - Possible VC2005 bug? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpdebuggingquestioncsharp
3 Posts 2 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.
  • R Offline
    R Offline
    Robert Buldoc
    wrote on last edited by
    #1

    [EDITTED] Got the answer in MSDN forum. It turns out I had a large global array, which I had defined earlier to test something and had forgotten about it! ah...bad programming practice!;P [/EDITTED] Hi, I have a relatively small Visual C++ project using MFC which allocates unusually hight amount of virtual memory as soon as the program starts(roughly 280MB), even before hitting the internal MFC stuff. When I debug them program in Visual Studio 2005 with a breakpoint at the beginning of int _tmainCRTStartup(void) function in crt0.c Windows Task Manager shows the following information: Memory Usage: 5,620K Peak Memory Usuage: 5,620K Page Faults: 1,420 VM Size: 282,360 K Paged Pool: 632K NP Pool: 2K Handles: 102 Threads: 1 GDI Object: 6 Running the program in release mode produces the same result. Also, compiler/linker settings are almost set to default. My question why the program allocates so much VM, before even its started WinMain() function? Is it a Windows issue or Visual C++? Any help appreciated! - Rob -- modified at 23:30 Saturday 16th September, 2006

    J 1 Reply Last reply
    0
    • R Robert Buldoc

      [EDITTED] Got the answer in MSDN forum. It turns out I had a large global array, which I had defined earlier to test something and had forgotten about it! ah...bad programming practice!;P [/EDITTED] Hi, I have a relatively small Visual C++ project using MFC which allocates unusually hight amount of virtual memory as soon as the program starts(roughly 280MB), even before hitting the internal MFC stuff. When I debug them program in Visual Studio 2005 with a breakpoint at the beginning of int _tmainCRTStartup(void) function in crt0.c Windows Task Manager shows the following information: Memory Usage: 5,620K Peak Memory Usuage: 5,620K Page Faults: 1,420 VM Size: 282,360 K Paged Pool: 632K NP Pool: 2K Handles: 102 Threads: 1 GDI Object: 6 Running the program in release mode produces the same result. Also, compiler/linker settings are almost set to default. My question why the program allocates so much VM, before even its started WinMain() function? Is it a Windows issue or Visual C++? Any help appreciated! - Rob -- modified at 23:30 Saturday 16th September, 2006

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      This is neither a windows or VC++ issue since it's not normal for a "plain" app unless you are using extensive DLLs especially from third party.

      Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

      R 1 Reply Last reply
      0
      • J Joe Woodbury

        This is neither a windows or VC++ issue since it's not normal for a "plain" app unless you are using extensive DLLs especially from third party.

        Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

        R Offline
        R Offline
        Robert Buldoc
        wrote on last edited by
        #3

        I am only using one thirdparty DLL coded by myself. SO I will have to investigate that. Thanks for the lead.

        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