473,386 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Virtual Alloc stops at 1.8gb

6
In an effort to understanding game behavior I have written a simple 10 line program which just calls VirtualAlloc (100mb each time) until it fails to allocate more memory. It always stops at 1.8gb as confirmed by the Virtual Size display in procexp.exe.

I was expecting more, at least 2gb for starters. But I have linked with /LargeAddressAware and used bcdedit (the so called /3gb switch) to increase the program space to 2.3gb. Hence, I don't understand why it would stop at 1.8gb.

I am running Visual C++ Express (2008) under Vista SP1.
Jul 12 '08 #1
2 1841
DreamU
6
OK, think I have a partial answer. When VirtualAlloc stopped I reduced the request size from 100mb to 50mb and then 25mb in which case it did indeed allocate Virtual Memory up to 2gb. Hence, fragmentation caused it to stop at 1.8gb.

Now GlobalMemoryStatus reports my Virtual Memory as 2.14gb. Does anyone have any insight into why bcdedit (and /LargeAddressAware) is not giving me the 2304mb which I set it to?
Jul 12 '08 #2
DreamU
6
Bah, rookie mistake, I double checked my linker options and for some reason 'Enable Large Addresses' (/LargeAddressAware) was not set. I remember setting it yesterday but should have checked it before posting. So, with that option set I now get 2.3gb of virtual memory allocated - just as I expected.
Jul 12 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Remi Ricard | last post by:
Hi, This is a code that reproduce my problem. #include <stdio.h> class A { public: virtual int get(int a)=0; int get(float a) {return 1;} };
7
by: sNOiSPAMt | last post by:
7.20.3#1 If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value,...
10
by: Ryan Wang | last post by:
Hi, here is the function: int sum(int a,int b) { int c; c = a + b; return c; }
2
by: Salvador | last post by:
Hi, I have a service that runs perfectly well on a normal server but when I install it on a virtual server the service suddenly stops (at random times), all the exceptions on my service are...
3
by: Dmitry Prokoptsev | last post by:
Hello, I need to write a class for exceptions which can be thrown, caught, stored and thrown once again. I have written the following code: --- begin --- #include <string> class Exception...
5
by: toton | last post by:
Hi, I want a few of my class to overload from a base class, where the base class contains common functionality. This is to avoid repetition of code, and may be reducing amount of code in binary,...
5
by: sunny3 | last post by:
Answer plz..........In C++ application virtual function is used. Assume if C++ stops supporting virtual functions, what changes need to be made in the application?
1
by: =?Utf-8?B?UlJN?= | last post by:
Hi all, I I tried to find the group for Virtual Server but failed, so I have placed this in general. My problem. During the installation of Virtual Server 2005 R2 SP1 The installer stops...
4
by: paul | last post by:
I was trying out the following sample code from Scotty Meyers: Effective C++ book: #include <iostream> class B { public: virtual void f() const { std::cout << "B::f()" << std::endl; } };
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.