Karim Belabas on Wed, 21 Jan 2015 22:39:14 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Stack size bugs and parisizemax


* Bill Allombert [2015-01-21 22:32]:
> On Wed, Jan 21, 2015 at 09:52:19PM +0100, Karim Belabas wrote:
> > * Jeroen Demeyer [2015-01-21 08:59]:
> > > On 2015-01-20 23:55, Bill Allombert wrote:
> > > >Do you think supporting what you call 'desesparation mode' to be valuable ?
> > > >So far Karim and I have been less than convinced.
> > > In http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1507#15, Karim
> > > clearly supported "desperation mode". But if you want to get rid of
> > > desperation mode completely, that would obviously a good (and simple)
> > > solution.
> > 
> > Hum, yes I did. But we didn't have parisizemax back then ! I now think
> > we should only support "desperation mode" when parisize == parisizemax.
> > 
> > I guess it's probably best to prevent garbage collection from internal
> > loops unless parisize = parisizemax, as you proposed.

I was not proposing a ready-to-implement algorithm, just embracing a
general philosophy in vague terms. Random garbage collection in internal
loops should be avoided if there's any possibility to increase stacksize
instead (because they are very costly and usually recover little memory).

> What about parisizemax = 0 ?

Same as parisize = parisizemax

> And do you mean default(parisize) or the
> current stacksize (parimainstack->size) ?

current stacksize.

> Also with unlucky choice of parisize and parisizemax, size == parisizemax
> might never happen: we might go from size < parisizemax to stack overflow
> in one go. (e.g. set parisize to 1G and parisizemax to 4G: parisizemax
> will be set to 4000002048, but parisize will be doubled to 2000000000 and
> then to 4000000000.  

Something like 

  (!parisizemax || stacksize > 0.99 parisizemax)

then.

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite de Bordeaux         Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`