Bill Allombert on Thu, 06 Apr 2017 10:14:21 +0200


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

Re: libpari: ellsea & ellcard caches


On Wed, Apr 05, 2017 at 10:25:12PM +0200, Jan Jancar wrote:
> Hi all,
> I'm currently using the ellsea and ellcard functions in
> libpari with some "cryptographic" sized curves.
> over F_p with p prime \in (2^128, 2^521) and
> over F_2^m with m \in (160, 512)
> 
> I am doing so repeatedly in one execution of my binary [1],
> I noticed that even if I reset the stack pointer to a value
> it was before calling ellcard, ellsea or ellff_get_card the
> memory usage seems to go up more than I would expect.
> 
> Does ellsea use some caches or otherwise allocate memory
> thats left after it returns? I am not getting memory leaks
> so not that.
> 
> I attached an example output of this behavior under 
> valgrind --tool=massif (read with ms_print [2]).
> The memory usage there rises steadily even when the binary
> only loops this (pseudo code):
> 
> pari_sp ltop = avma
> generate random: field, a, b parameters
> ellinit([a,b], field)
> ellsea(e)

Ah, I see: are you using PARI 2.9.1 ?
Then upgrading to PARI 2.9.2 (released yesterday) should fix this bug:
     31- ellsea leaked clones

Cheers,
Bill.