Hi,
It would be better for you to allocate smaller memory blocks, instead of
only
one big block. I am not very aware of fine details in the ways modern
operating
systems handle memory, but there is one rule they must follow : memory
within a
memory block must keep continuous, so that it can be fully addressed. So
you
must be sure that you can have all these 1000 MB you want to allocate fit
into
a single memory chip. Even if this is physically not the problem,
algorithms
within the operating system may be unable to make all this memory fit
within a
continuous block...
So, once again, split your buffer into a few smaller ones.
Hoping this will help,
Alexandre
Alon Hessing wrote:
> Hi,
> I try to allocate memory simply by using the new operator:
> void* pMem = new unsigned char[1000*1024*1024]
> Notice that I'm trying to allocate 1000 MB in a computer with 2 GB
> memory.
> The allocation fail and the return value is NULL.
> The same allocation succeeded when I doing it from a small test
> program I wrote(and not as a part of my original project).
> I managed to allocate 700MB.
> Do you have any idea what could cause such a behaviour?
>
> Please help
>
> Alon


|