EVOLUTION-MANAGER
Edit File: Rprofmem.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Enable Profiling of R's Memory Use</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Rprofmem {utils}"><tr><td>Rprofmem {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Enable Profiling of R's Memory Use</h2> <h3>Description</h3> <p>Enable or disable reporting of memory allocation in R. </p> <h3>Usage</h3> <pre> Rprofmem(filename = "Rprofmem.out", append = FALSE, threshold = 0) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>filename</code></td> <td> <p>The file to be used for recording the memory allocations. Set to <code>NULL</code> or <code>""</code> to disable reporting. </p> </td></tr> <tr valign="top"><td><code>append</code></td> <td> <p>logical: should the file be over-written or appended to? </p> </td></tr> <tr valign="top"><td><code>threshold</code></td> <td> <p>numeric: allocations on R's "large vector" heap larger than this number of bytes will be reported. </p> </td></tr> </table> <h3>Details</h3> <p>Enabling profiling automatically disables any existing profiling to another or the same file. </p> <p>Profiling writes the call stack to the specified file every time <code>malloc</code> is called to allocate a large vector object or to allocate a page of memory for small objects. The size of a page of memory and the size above which <code>malloc</code> is used for vectors are compile-time constants, by default 2000 and 128 bytes respectively. </p> <p>The profiler tracks allocations, some of which will be to previously used memory and will not increase the total memory use of R. </p> <h3>Value</h3> <p>None </p> <h3>Note</h3> <p>The memory profiler slows down R even when not in use, and so is a compile-time option. (It is enabled in a standard Windows build of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>.) </p> <p>The memory profiler can be used at the same time as other <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> and C profilers. </p> <h3>See Also</h3> <p>The R sampling profiler, <code><a href="Rprof.html">Rprof</a></code> also collects memory information. </p> <p><code><a href="../../base/html/tracemem.html">tracemem</a></code> traces duplications of specific objects. </p> <p>The "Writing R Extensions" manual section on "Tidying and profiling R code" </p> <h3>Examples</h3> <pre>## Not run: ## not supported unless R is compiled to support it. Rprofmem("Rprofmem.out", threshold = 1000) example(glm) Rprofmem(NULL) noquote(readLines("Rprofmem.out", n = 5)) ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>