www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - new and GC.malloc fail, core.stdc.malloc works

reply "John Colvin" <john.loughran.colvin gmail.com> writes:
I'm getting OutOfMemoryErrors on some machines when calling 
GC.malloc (or new) for anything large (more than about 1GB), 
where core.stdc.malloc works fine.

Anyone ever come accross this before? I suspect it's related to 
some system memory monitor/management as it's only happening to 
me on supercomputer nodes.
Jun 24 2014
next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Tuesday, 24 June 2014 at 10:06:10 UTC, John Colvin wrote:
 I'm getting OutOfMemoryErrors on some machines when calling 
 GC.malloc (or new) for anything large (more than about 1GB), 
 where core.stdc.malloc works fine.

 Anyone ever come accross this before? I suspect it's related to 
 some system memory monitor/management as it's only happening to 
 me on supercomputer nodes.
P.S. yes I've checked the return value of core.stdc.malloc. Also, I'm not doing anything silly like calling them one after the other and then wondering why the second one doesn't work (although seeing as I've got ~24GB of RAM to play with that shouldn't be a problem).
Jun 24 2014
prev sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
John Colvin:

 I'm getting OutOfMemoryErrors on some machines when calling 
 GC.malloc (or new) for anything large (more than about 1GB), 
 where core.stdc.malloc works fine.
I think that when you go in territories where most people have not done much coding in D, like allocating than 1 GB in one shot, you hit some bugs. In general if some part of D is not used a lot, you have to assume it's buggy. Please report in Bugzilla the problems you have located. Bye, bearophile
Jun 24 2014
parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Tuesday, 24 June 2014 at 10:16:38 UTC, bearophile wrote:
 John Colvin:

 I'm getting OutOfMemoryErrors on some machines when calling 
 GC.malloc (or new) for anything large (more than about 1GB), 
 where core.stdc.malloc works fine.
I think that when you go in territories where most people have not done much coding in D, like allocating than 1 GB in one shot, you hit some bugs. In general if some part of D is not used a lot, you have to assume it's buggy. Please report in Bugzilla the problems you have located. Bye, bearophile
After a little more investigation It seems that I'm getting an OutOfMemoryError at around 1GB memory usage, regardless of the granularity of allocation.
Jun 25 2014
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Wednesday, 25 June 2014 at 14:44:22 UTC, John Colvin wrote:
 On Tuesday, 24 June 2014 at 10:16:38 UTC, bearophile wrote:
 John Colvin:

 I'm getting OutOfMemoryErrors on some machines when calling 
 GC.malloc (or new) for anything large (more than about 1GB), 
 where core.stdc.malloc works fine.
I think that when you go in territories where most people have not done much coding in D, like allocating than 1 GB in one shot, you hit some bugs. In general if some part of D is not used a lot, you have to assume it's buggy. Please report in Bugzilla the problems you have located. Bye, bearophile
After a little more investigation It seems that I'm getting an OutOfMemoryError at around 1GB memory usage, regardless of the granularity of allocation.
User error, carry on, nothing to see here...
Jun 26 2014