[computer-go] Allocating lots of memory in C++?

Chrilly c.donninger at wavenet.at
Tue Aug 15 11:27:20 PDT 2006


The restriction is not C++ but the OS. There is a standard-stack size. This is used to save memory but also to check stack-violations. The standard settings are in general very generous. If one changes the setting, one should have very strongs reasons to do so.
I assume you use Linux. We have a similar problem in Hydra for shared memory allocation. There is a standard boundary of 32MB for shared memory (depends on the Linux version). One can set this higher in one of the kernel configuration files (do not remember the full details at the moment, we got the hint from Vincent Diepeveen who ran before us in the same problem). But this works only on the machine the reconfiguration is done. In case of Hydra, this is no problem, there is anyway only one decicated cluster Hydra is running on. But for a normal programm its not a good idea to rely on a reconfiguration of the kernel parameters.

I would use malloc().

Chrilly


  ----- Original Message ----- 
  From: Peter Drake 
  To: computer-go 
  Sent: Tuesday, August 15, 2006 7:48 PM
  Subject: Re: [computer-go] Allocating lots of memory in C++?


  Incidentally, this is stack allocation, not malloc or new.


  Peter Drake
  Assistant Professor of Computer Science
  Lewis & Clark College
  http://www.lclark.edu/~drake/








  On Aug 15, 2006, at 10:47 AM, Peter Drake wrote:


    I need to statically allocate an enormous block of memory (hundreds of megabytes) for Orego to store the search tree. When I allocate 1000 nodes, the program works fine. When I try to allocate 10000 (around 15MB), I get SIGSEGV. How do I crank up the allowable memory?


    Peter Drake
    Assistant Professor of Computer Science
    Lewis & Clark College
    http://www.lclark.edu/~drake/








    _______________________________________________
    computer-go mailing list
    computer-go at computer-go.org
    http://www.computer-go.org/mailman/listinfo/computer-go/




------------------------------------------------------------------------------


  _______________________________________________
  computer-go mailing list
  computer-go at computer-go.org
  http://www.computer-go.org/mailman/listinfo/computer-go/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://computer-go.org/pipermail/computer-go/attachments/20060815/7a43a806/attachment.htm


More information about the computer-go mailing list