Le 30/08/2016 à 19:06, William Stein a écrit : > On Tue, Aug 30, 2016 at 9:56 AM, Thierry Dumont > <tdum...@math.univ-lyon1.fr> wrote: >> I have two computers, and sage installed on both: >> >> 1) Ubuntu 12.04 , sage-7.3 on an nfs mount,y >> >> 2) Ubuntu 16.04, sage-7.3 on a local system, on a ssd. >> >> With the first one, sage starts slowly (as could be expected!), and I >> have time to look at sage starting with "top". And during the starting >> phase, before the prompt, sage uses more than 16 GB of virtual memory >> (VIRT: 16.380g); the same quantity is used when stopping sage (in the >> console interface). >> It seems quite large, no ? >> >> With the second machine, it's more difficult to see what happens with >> top, but it does not seems to use more than 7gb. >> >> Why such a large amount of memory ? (ok, it's virtual, but it's large, >> no ?). > > I think this is a hack that is used by PARI/GP, due to their > "interesting" primitive (but fast!) memory design. > > -- William > >> >> t.d. >>
Mhhh, yes.And they certainly do something with what they allocate; I tried this (c++): ------------------------------- #define DO_SOMETHING int main() { //allocate a 16 gb array. const long int n=2*1000000000; long int *x=new long int[n]; #ifdef DO_SOMETHING for(long int i=0;i<n;i++) x[i]=0; #endif } ------------------------------ With DO_SOMETHING defined, time ./a.out: real 0m7.352s user 0m2.611s sys 0m4.648s and DO_SOMETHING undefined (as just allocating has quite no cost): real 0m0.004s user 0m0.004s sys 0m0.000s t. -- 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>>