On Wed, Feb 6, 2019 at 10:46 AM Dima Pasechnik <dimp...@gmail.com> wrote:
>
> On Wed, Feb 6, 2019 at 9:16 AM Simon Brandhorst <sbrandho...@web.de> wrote:
> >
> > After running
> >
> > sage: V = libgap.GF(3)^2000
> > sage: libgap(V.Subspaces(1000)).List()
> > ---------------------------------------------------------------------------
> > ValueError                                Traceback (most recent call last)
> > .....
> > ValueError: libGAP: Error, reached the pre-set memory limit
> > (change it with the -o command line option)
> >
> > libgap does not free the memory after this command.
> > So running it a few times will eat up all the memory
> > How to free it?
> > And how can I kill the libgap session and start a new one?
>
> I believe this is not implemented; this probably is possible, erasing
> the cache of GAP object handles, calling dlclose(), and starting
> libgap again, but there must be a lot of tricky work to get it work.
> (I imagine one might want this feature for other library interfaces too)
>
> Open a trac ticket...

The Python interpreter's embedding API has a Py_Finalize (as
contrasted with Py_Initialize) which cleans up all of the
interpreter's internal data structures and tries to put things into a
sane state such that it should be possible to re-Py_Initialize.

GAP (understandably) does not currently have such a function.  But it
could!  Perhaps that should be proposed upstream--it would not be too
difficult to do, I don't think, at least in principle.  But there may
be caveats (see, for example, the caveats to Py_Finalize; particularly
the one about extension modules not behaving well when Python is
re-initialized:
https://docs.python.org/3/c-api/init.html#c.Py_FinalizeEx)

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

Reply via email to