Le 08/10/2018 à 12:56, Dima Pasechnik a écrit :
> On Mon, Oct 8, 2018 at 11:34 AM Thierry Dumont
> <tdum...@math.univ-lyon1.fr> 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.
> 
>>
RDF are machine double floats; that is to say C "double", which take 8
bytes.
So my list should use less than 1gb, if it phi was a C array.
Am I wrong ?


>> --
>> 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 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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

<<attachment: tdumont.vcf>>

Reply via email to