On Mon, Oct 8, 2018 at 11:34 AM Thierry Dumont
<[email protected]> wrote:
>
> I do:
>
> N= 10^8
> theta= RDF(2*pi/N)
> phi=[i*theta for i in range(0,N)]
>
> not something sophisticated...!
>
> Also: it is not a good idea do do that: better use numpy. BUT
>
> looking at "top" during the computation of
> phi=[i*theta for i in range(0,N)],
> the memory used jumps to 3Gb and then grows, grows... until it reaches
> the limits of my 8GB machine.
>
> python lists are not known to be very efficient, ok. But this is a bit
> too much, no ?

If you limit the memory to 4GB you can do the same out of memory stunt
using plain python:

$ ulimit -Sv 4000000
$ ./sage --python
Python 2.7.15 (default, Sep 19 2018, 15:29:25)
[GCC 7.3.1 20180130 (Red Hat 7.3.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> N=10**8
>>> theta=6.283185307179586e-08
>>> phi=[i*theta for i in range(0,N)]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError


Perhaps RDF takes more memory, I don't know - anyway, it's not
Sage-specific IMHO.

>
> --
> 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 https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to