Open letter: Who steals memory? :-)
- To: mathgroup at smc.vnet.net
- Subject: [mg47311] Open letter: Who steals memory? :-)
- From: derov at rambler.ru (Derov Alexey)
- Date: Mon, 5 Apr 2004 05:22:48 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Who steals memory? OR Is it possible to use Mathematica for Technical Computations YES or NOT? Dear colleagues, once again I want to consider one aged problem. Who steals memory? (I am far from idea that the corporation Wolfram Res. steals memory :- ) on my computer), but some problem in this field disturbs me. For example we shall consider a problem of linear equations systems solution A . x = b, were A - matrix, b - vector, x - required vector Let's try to solve the given system by method of Gauss elimination (LU-factorization). Well-known, that this method does not demand too much additional memory. But that we see n = 1024; A = Table[Random[],{n},{n}]; b = Table[Random[],{n}]; MaxMemoryUsed[ ]/(1024*1024.) - - - > 10.0353 ByteCount[A]/(1024*1024.) - - - > 8.000 x1 = LinearSolve[A,b,Method->OneStepRowReduction]; MaxMemoryUsed[ ]/(1024*1024.) - - - > 70.206 But other method gives more well result x2 = LinearSolve[A,b]; MaxMemoryUsed[]/(1024*1024.) - - -> 18.0844 The "Mathematica" is demanded so many memory, In my modest opinion it is too much memory. But there can be I have not understood options: Method -> OneStepRowReduction Then I offer one more way, Let's write the program to solution of linear equations systems independently. We use the same method of Gauss elimination. In our notations: A = g[[All,Range[1,n]]]; b = g[[All,n+1]]; Realization of the given algorithm on any the programming language FORTRAN or C will not use additional memory. But, "Mathematica" demands too much again: n = 1024; g = Table[Random[],{n},{n+1}]; MaxMemoryUsed[ ]/(1024*1024.) - - - > 10.03 Do[ g[[i,All]] /= g[[i,i]]; Do[ g[[j,All]]-=g[[j,i]]*g[[i,All]] ,{ j,i+1,n}]; ,{i,1,n}]; x=Table[0,{n}]; Do[ x[[i]]+=g[[i,n+1]]; x[[i]]-=g[[i,Range[i+1,n]]]. x[[Range[i+1,n]]] ,{i,n,1,-1}]; MaxMemoryUsed[ ]/(1024*1024.) - - - > 18.1024 WHO STEALS MEMORY? :-) My problem has arisen as follows. I solve the system A .x = b, the matrix - A is located in memory well, but I don't solve this problem memory does not suffice! Is it possible to use "Mathematica" for heavy computations YES or NOT?, This question to have to consider. COLLEAGUES, ARE YOU AGREE WITH ME? Derov Alex
- Follow-Ups:
- Re: Open letter: Who steals memory? :-)
- From: Daniel Lichtblau <danl@wolfram.com>
- Re: Open letter: Who steals memory? :-)