Hi,
I found some answers myself. The memory usage can be found out with
get_memory_usage()
and there is a garbage collection that can be called manually via
import gc
gc.collect()
so I could do something like
import gc
i=i+1
if (i%10000==0):
if get_memory_usage()>3000:
gc.collect()
but shouldn't there be a more "automatic" way? Thanks!
Best,
Stefan
On Monday, February 18, 2013 2:17:16 PM UTC+1, switzel wrote:
>
> Hi,
>
> I am wondering about the following phenomenon: I have a list "interrels"
> of polynomials in many variables and a list "potential_sols" of potential
> solutions and I am using the following code to check which are actually
> solutions (roots). I use the following code
>
> sols=[]
> for psol in potential_sols:
> for interrel in interrels:
> if interrel(*psol)!=0:
> break
> else:
> print(psol)
> sols.append(psol)
>
> I am not surprised (under my circumstances) that this takes long, though
> actually it wasn't that bad at first. What surprises me is that it uses
> huge amounts of memory. The actual data don't take that much memory and the
> code just linearly runs through all possibilities so it practically
> shouldn't need any extra memory at all (at most another copy of
> potential_sols). But instead it had filled the 4 GB physical memory plus 2
> GB swap when I canceled it (of course by that time it also was terribly
> slow, just because of all the swapping). This seems to suggest memory leaks.
> Is there any way I could check what part of sage (and which data
> structures) use how much memory? Are there any known issues about memory
> leaks related to polynomial rings over finite fields? Is there a garbage
> collection I have to call manually?
> Thanks for any help!
>
> Best,
> Stefan
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.