>>Visual Studio 2008, which I assume is a 64 bit compiler.
No -- its a 32-bit compiler. But the Pro version can compile 64-bit code if you provide the right options. Just because you compile something on a 64-bit os doesn't mean you will automatically get a 64-bit program.
Post a short example program that produces the problem you are talking about.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I just tested a short program and it stopped at about 2Gig just as you had also reported. I believe the reason is a 32-bit program can only access 2 Gig RAM.
To get the 64-bit version of VC++ 2008 you have to select an option during installation. Here is how to do it.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I don't know how to enable 64-bit. From what I see in the link I posted, and read in other places, its enabled during installation of the compiler. There is apparently an installation option that lets you install the 64-bit compiler. You may have to reinstall the compiler in order to get it.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
All my Windows work is still under Win32.
Remember in 32-bit land you only have about 3.2Gig totally available to your application, which really works out to about 2Gig because Dev Studio is an oinker! It's a memory hog! Especially in a debug build.
You're using C++ compilers and using C memory allocation!
You should be using new/delete new[]/delete[]. Not Malloc Free.
For fun try GlobalAlloc(), under Vista 64. see how much it lets you allocate!
wildgoose
Practically a Posting Shark
896 posts since Jun 2009
Reputation Points: 546
Solved Threads: 99
>>which really works out to about 2Gig because Dev Studio
What is Dev Studio? You mean Dev-C++? In any event it has nothing to do with the problem and does not affect the amount of memory a program can use, unless the computer has less than 2 Gig of RAM and is out of hard drive swap space.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Sorry I meant Visual Studio. (Dev Studio is a nickname for it!)
And Windows swaps out memory as you say, but DevStudio is the memory hog. Windows gives memory to the more active application and Visual Studio is a memory hog when it runs. Totally Shut down Visual Studio and run your test again as a standalone application.
Better yet, Reboot, then run your program and check your numbers!
wildgoose
Practically a Posting Shark
896 posts since Jun 2009
Reputation Points: 546
Solved Threads: 99
Sorry I meant Visual Studio. (Dev Studio is a nickname for it!)
Never heard of that one?
Anyway: thereal question is: Why would you ever want to use 2gb (!) of memory? I bet there's a better way to solve your problem then using 2gb of ram
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
Sorry I meant Visual Studio. (Dev Studio is a nickname for it!)
He has a point. Version 5 and 6 were called MS Developer Studio in many manuals and thats why the path for Visual Studio 5 and 6 was %programfiles%/devstudio
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601