File: jmemprof.Rd

package info (click to toggle)
rjava 1.0-14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,188 kB
  • sloc: java: 13,223; ansic: 5,503; sh: 3,776; xml: 325; makefile: 250; perl: 33
file content (48 lines) | stat: -rw-r--r-- 1,567 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
\name{jmemprof}
\alias{.jmemprof}
\title{
  rJava memory profiler
}
\description{
  \code{.jmemprof} enables or disables rJava memory profiling. If rJava
  was compiled without memory profiling support, then a call to this
  function always causes an error.
}
\usage{
.jmemprof(file = "-")
}
\arguments{
  \item{file}{file to write profiling information to or \code{NULL} to
    disable profiling}
}
\value{
  Returns \code{NULL}.
}
\details{
  The \code{file} parameter must be either a filename (which will be
  opened in append-mode) or "-" to use standard output or \code{NULL} to
  disable profiling. An empty string "" is equivalent to \code{NULL} in
  this context.

  Note that lots of finalizers are run only when R exists, so usually
  you want to enable profiling early and let R exit to get a sensible
  profile. Running gc may be helpful to get rid of references that can
  be collected in R.

  A simple perl script is provided to analyze the result of the
  profiler. Due to its simple text format, it is possible to capture
  entire stdout including the profiler information to have both the
  console context for the allocations and the profile. Memory profiling
  is also helpful if rJava debug is enabled.

  Note that memory profiling support must be compiled in rJava and it is
  by default compiled only if debug mode is enabled (which is not the
  case by default).
}
\examples{
## memory profiling support is optional so only works when enabled
tryCatch(
.jmemprof("rJava.mem.profile.txt"),
error=function(e) message(e))
}
\keyword{interface}