Thread overview
allocating gobs of memory to my program
Jun 16, 2011
Charles McAnany
Jun 16, 2011
David Nadlinger
Jun 17, 2011
Charles McAnany
June 16, 2011
Hi, all. I'm back! I've got an enormous array that I need to store,
preferably in RAM. (It's iterated a bunch.)
I have 16 Gb on my machine, and at any time, about 12 Gb is free.
I'd like to be able to use about 10 Gb for this program. But when I
try to use more than about 800 Mb, I get "Memory allocation failed."
(I'm using new long[], not malloc(), but I do free() variables
because the garbage collector was having trouble keeping up with
me.) Is there a switch I can mark to say that the runtime might have
to deal with lots of memory?
Incidentally,
Win7 x64, Intel I7 @4.4 GHz, compiling with dmd -O -release -inline.

Thanks,
Charles
June 16, 2011
On 6/17/11 12:32 AM, Charles McAnany wrote:
> Win7 x64, Intel I7 @4.4 GHz, compiling with dmd -O -release -inline.

Regardless whether you are running on x86 or x86_64, DMD is only able to create 32 bit binaries on Windows.

David
June 17, 2011
Hm. I'm not too good on architecture - does that mean it's impossible for an x32 program to have access to more memory? Is there, maybe, an x64 C library that I could use to abstract the memory out (Just a huge array wrapper, basically)? Or, that failing, does GCC automatically generate x64 code on an x64 machine? I could probably write the procedure in C... but yuck.

David Nadlinger Wrote:

> On 6/17/11 12:32 AM, Charles McAnany wrote:
> > Win7 x64, Intel I7 @4.4 GHz, compiling with dmd -O -release -inline.
> 
> Regardless whether you are running on x86 or x86_64, DMD is only able to create 32 bit binaries on Windows.
> 
> David

June 17, 2011
On Thu, Jun 16, 2011 at 10:20 PM, Charles McAnany <mcanance@rose-hulman.edu> wrote:
> Hm. I'm not too good on architecture - does that mean it's impossible for an x32 program to have access to more memory?
> Is there, maybe, an x64 C library that I could use to abstract the memory out (Just a huge array wrapper, basically)? Or, that failing, does GCC automatically generate x64 code on an x64 machine? I could probably write the procedure in C... but yuck.
>
> David Nadlinger Wrote:
>
>> On 6/17/11 12:32 AM, Charles McAnany wrote:
>> > Win7 x64, Intel I7 @4.4 GHz, compiling with dmd -O -release -inline.
>>
>> Regardless whether you are running on x86 or x86_64, DMD is only able to create 32 bit binaries on Windows.
>>
>> David
>

I don't know why you can't allocate more than 800mb but if you want to get around this by caching in other processes' memory then I can recommend memcache: http://memcached.org/