Loïc Grenié on Tue, 20 Jan 2015 21:23:39 +0100


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

Re: Stack size bugs and parisizemax


2015-01-20 16:31 GMT+01:00 Jeroen Demeyer <jdemeyer@cage.ugent.be>:
> Hello pari-dev,
>
> At the atelier you mentioned that it shouldn't hurt to set a small parisize
> but a large parisizemax. In the light of this, bugs where some computation
> is much slower with a small parisize are more serious.
>
> I think there should be some general solution to this problem which takes
> into account the value of parisizemax. The idea should be: do not collect
> garbage too often if instead we can increase parisize.
>
> For this reason, I'm not completely happy with
> 25b0af6b8510e5b2feaa0d47fababa2fd25921e0. My proposal would be: if parisize
> < parisizemax, then call gerepileall() at most once per outer loop
> iteration. Something like:
>
> for (...) /* outer loop */
> {
>   int gc_allowed = 1;
>   for (...) /* inner loop */
>   {
>     if (gc_allowed && gc_needed(...))
>     {
>       gerepileall(...);
>       gc_allowed = (parisize == parisizemax);
>     }
>   }
> }

     I've long thought about a way to rate-limit GC: if we GC more than
  1000 times/s then either warn or increase stack size. The problem is
  that I don't know how to do that reasonably.

         Loïc