Op vrijdag 22 november 2013 18:48:27 UTC schreef Nils Bruin:
>
> On Friday, November 22, 2013 10:26:52 AM UTC-8, Peter Bruin wrote:
>>
>> The results of all GP command are stored in an array named 'sage' inside 
>> GP.  If you execute too many commands, this array apparently isn't enlarged 
>> anymore.  I suspect that this is because GP runs out of stack space and 
>> that Sage's GP interface does not notice this.
>>
>> I don't see a quick and easy solution.
>>
>  
> It might be worthwhile to add that the reason all those results are stored 
> in an array is because (at least at first) they correspond to a "gp" object 
> in sage, so we need a place to keep a reference to the value in gp. The 
> solution to this issue is freeing up the entries in gp when the result is 
> not needed any more, i.e., if the corresponding sage object gets 
> deallocated. Since you probably wouldn't want to do this via a "__delete__" 
> method, because that interferes with python's GC, you'd have to have a cdef 
> class on which you do the manipulation in gp in the __dealloc__.  (and then 
> probably make the entry in the array part of a "free-list"). The 
> __dealloc__ could run under quite adverse conditions, so I'm not sure that 
> driving a pexpect interface is a safe thing to do. One could queue the 
> re-use for the next allocation, though.
>

I agree that something like this would be the definitive fix.  To partially 
solve the above bug, we should make sure doubling of the "sage" array works 
when an allocatemem() has to be done; this seems to be broken, and I just 
opened a ticket for it (#15446).  It is only a partial fix because doing GP 
calculations still leaks memory.

Peter

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to