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 = "")
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
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
?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
4 matches
Mail list logo