Allan Engelhardt <all...@cybaea.com> 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 = "")
[...] > The scan method should be plenty fast. Change as appropriate if your > definition of memory is different from virtual size. Thanks, that works well. I'm on an older kernel (2.6.18), so I only have 42 entries in /proc/pid/stat, but VSZ is still in position 23. Looking at the proc man page also shows /proc/[pid]/statm, which collects some of the memory information, but requires me to know what the page size is to make sense of it. Gegards, Johann ______________________________________________ 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.