Re: [R] Memory Management under Linux
It would be very useful if you would post some information about what exactly you are doing. There si something with the size of the data object you are processing ('str' would help us understand it) and then a portion of the script (both before and after the error message) so we can understand the transformation that you are doing. It is very easy to generate a similar message: x - matrix(0,2, 2) Error: cannot allocate vector of size 3.0 Gb but unless you know the context, it is almost impossible to give advice. It also depends on if you are in some function calls were copies of objects may have been made, etc. On Thu, Nov 4, 2010 at 7:52 PM, ricardo souza ricsouz...@yahoo.com.br wrote: Dear all, I am using ubuntu linux 32 with 4 Gb. I am running a very small script and I always got the same error message: CAN NOT ALLOCATE A VECTOR OF SIZE 231.8 Mb. I have reading carefully the instruction in ?Memory. Using the function gc() I got very low numbers of memory (please sea below). I know that it has been posted several times at r-help (http://tolstoy.newcastle.edu.au/R/help/05/06/7565.html#7627qlink2). However I did not find yet the solution to improve my memory issue in Linux. Somebody cold please give some instruction how to improve my memory under linux? gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 170934 4.6 35 9.4 35 9.4 Vcells 195920 1.5 786432 6.0 781384 6.0 INCREASING THE R MEMORY FOLLOWING THE INSTRUCTION IN ?Memory I started R with: R --min-vsize=10M --max-vsize=4G --min-nsize=500k --max-nsize=900M gc() used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) Ncells 130433 3.5 50 13.4 25200 50 13.4 Vcells 81138 0.7 1310720 10.0 NA 499143 3.9 It increased but not so much! Please, please let me know. I have read all r-help about this matter, but not solution. Thanks for your attention! Ricardo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Memory Management under Linux
Dear Jim, Thanks for your attention. I am running a geostatistic analysis with geoR that is computational intense. At the end my analysis I call the function krige.control and krige.conv. Do you have any idea how to improve the memory allocation in Linux? Thanks, Ricardo De: jim holtman jholt...@gmail.com Assunto: Re: [R] Memory Management under Linux Para: ricardo souza ricsouz...@yahoo.com.br Cc: r-help@r-project.org Data: Sexta-feira, 5 de Novembro de 2010, 10:21 It would be very useful if you would post some information about what exactly you are doing. There si something with the size of the data object you are processing ('str' would help us understand it) and then a portion of the script (both before and after the error message) so we can understand the transformation that you are doing. It is very easy to generate a similar message: x - matrix(0,2, 2) Error: cannot allocate vector of size 3.0 Gb but unless you know the context, it is almost impossible to give advice. It also depends on if you are in some function calls were copies of objects may have been made, etc. On Thu, Nov 4, 2010 at 7:52 PM, ricardo souza ricsouz...@yahoo.com.br wrote: Dear all, I am using ubuntu linux 32 with 4 Gb. I am running a very small script and I always got the same error message: CAN NOT ALLOCATE A VECTOR OF SIZE 231.8 Mb. I have reading carefully the instruction in ?Memory. Using the function gc() I got very low numbers of memory (please sea below). I know that it has been posted several times at r-help (http://tolstoy.newcastle.edu.au/R/help/05/06/7565.html#7627qlink2). However I did not find yet the solution to improve my memory issue in Linux. Somebody cold please give some instruction how to improve my memory under linux? gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 170934 4.6 35 9.4 35 9.4 Vcells 195920 1.5 786432 6.0 781384 6.0 INCREASING THE R MEMORY FOLLOWING THE INSTRUCTION IN ?Memory I started R with: R --min-vsize=10M --max-vsize=4G --min-nsize=500k --max-nsize=900M gc() used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) Ncells 130433 3.5 50 13.4 25200 50 13.4 Vcells 81138 0.7 1310720 10.0 NA 499143 3.9 It increased but not so much! Please, please let me know. I have read all r-help about this matter, but not solution. Thanks for your attention! Ricardo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Memory Management under Linux
I would do some monitoring (debugging) of the script by placing some 'gc()' calls in the sequence of statements leading to the problem to see what the memory usage is at that point. Take a close look at the sizes of your objects. If it is happening in some function you have called, you may have to take a look and understand if multiple copies are being made. Most problems of this type may require that you put hooks in your code (most of the stuff that I write has it in so I can isolate performance problems) to gain an understanding of what is happening when. To improve memory allocation, you first have to understand what is causing the problem, and enough information has not been provided so that I could make a comment on it. There are lots of rules of thumb that can be used, but many depend on exactly what you are trying to do. On Fri, Nov 5, 2010 at 2:59 PM, ricardo souza ricsouz...@yahoo.com.brwrote: Dear Jim, Thanks for your attention. I am running a geostatistic analysis with geoR that is computational intense. At the end my analysis I call the function krige.control and krige.conv. Do you have any idea how to improve the memory allocation in Linux? Thanks, Ricardo De: jim holtman jholt...@gmail.com Assunto: Re: [R] Memory Management under Linux Para: ricardo souza ricsouz...@yahoo.com.br Cc: r-help@r-project.org Data: Sexta-feira, 5 de Novembro de 2010, 10:21 It would be very useful if you would post some information about what exactly you are doing. There si something with the size of the data object you are processing ('str' would help us understand it) and then a portion of the script (both before and after the error message) so we can understand the transformation that you are doing. It is very easy to generate a similar message: x - matrix(0,2, 2) Error: cannot allocate vector of size 3.0 Gb but unless you know the context, it is almost impossible to give advice. It also depends on if you are in some function calls were copies of objects may have been made, etc. On Thu, Nov 4, 2010 at 7:52 PM, ricardo souza ricsouz...@yahoo.com.brhttp://mc/compose?to=ricsouz...@yahoo.com.br wrote: Dear all, I am using ubuntu linux 32 with 4 Gb. I am running a very small script and I always got the same error message: CAN NOT ALLOCATE A VECTOR OF SIZE 231.8 Mb. I have reading carefully the instruction in ?Memory. Using the function gc() I got very low numbers of memory (please sea below). I know that it has been posted several times at r-help ( http://tolstoy.newcastle.edu.au/R/help/05/06/7565.html#7627qlink2). However I did not find yet the solution to improve my memory issue in Linux. Somebody cold please give some instruction how to improve my memory under linux? gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 170934 4.6 35 9.4 35 9.4 Vcells 195920 1.5 786432 6.0 781384 6.0 INCREASING THE R MEMORY FOLLOWING THE INSTRUCTION IN ?Memory I started R with: R --min-vsize=10M --max-vsize=4G --min-nsize=500k --max-nsize=900M gc() used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) Ncells 130433 3.5 50 13.4 25200 50 13.4 Vcells 81138 0.71310720 10.0 NA 499143 3.9 It increased but not so much! Please, please let me know. I have read all r-help about this matter, but not solution. Thanks for your attention! Ricardo [[alternative HTML version deleted]] __ R-help@r-project.org http://mc/compose?to=r-h...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.