Re: [R] memory use without running gc()

2010-08-10 Thread Johann Hibschman
Allan Engelhardt writes: > ### Method 2 > ## Setup > file <- paste("/proc", Sys.getpid(), "stat", sep = "/") > what <- vector("list", 44); what[[23]] <- integer(0) > ## In your logging routine > vsz <- scan(file, what = what, quiet = TRUE)[[23]]/1024 > cat("Virtual size: ", vsz, "\n", sep = "")

Re: [R] memory use without running gc()

2010-08-09 Thread Allan Engelhardt
How about asking the operating system, e.g. ### Method 1 ## Setup cmd <- paste("ps -o vsz", Sys.getpid()) ## In your logging routine z <- system(cmd, intern = TRUE) cat("Virtual size: ", z[2], "\n", sep = "") ### Method 2 ## Setup file <- paste("/proc", Sys.getpid(), "stat", sep = "/") what <- v

Re: [R] memory use without running gc()

2010-08-06 Thread Johann Hibschman
jim holtman writes: > ?memory.size Only works on Windows. I guess I should have specified; this is on Linux. Thanks, Johann __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

Re: [R] memory use without running gc()

2010-08-06 Thread jim holtman
?memory.size On Fri, Aug 6, 2010 at 1:00 PM, Johann Hibschman wrote: > Is there any way to get the current memory used by R without running > gc()? > > I'd like to include the memory usage in logging output, but calling gc() > to get that information takes long enough to be noticeable (~ 6 s with