|Bill Allombert on Tue, 08 Apr 2014 15:16:54 +0200|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|Re: dynamic pari stack|
On Tue, Apr 01, 2014 at 05:38:38PM +0200, Bill Allombert wrote: > Dear PARI-dev, > > I have added a new default "parisizemax" to allow the stack to grow dynamically. > > How does that works: > - if parisizemax=0, then nothing change. > - otherwise the stack size will double automatically when needed, > up to parisizemax. > > A warning is displayed: > > *** Warning: increasing stack size to 16000000. > > Advantages: > Only the amount of stack actually needed for a computation is used, > and the user can still limit the amount of memory used by GP > programs (to prevent bugs in programs to crash the system by using > all the memory). > On systems allowing to overcommit memory, it is possible to set > parisizemax to a very large value, since only the used stack will be > actually allocated in memory. > > Further works: > - Add support for mmap: this is a much nicer alternative to overcommit. > In particular this will allow to reduce the stack size to free some > memory. I have commited a change (b2d1a53f1) that implement that b2d1a53f1. You will need to rerun Configure to take advantage of it. Now, when the stack has been increased, the extra memory is freed when GP returns to the prompt. Cheers, Bill.