Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the cost of enabling memory profiling?

R's default configuration options disable memory profiling, shared-library libR, static-library libR.a, GNU gettext, valgrind headers, and link-time optimisation.

Some of these (like valgrind) must just be because not everyone will use it. Others might be answered elsewhere on SO (like Is there any reason why not to use link time optimization? might answer --enable-lto[=no]).

But what is the possible disadvantage or cost of enabling memory profiling in R?

like image 667
isomorphismes Avatar asked Jul 24 '15 18:07

isomorphismes


People also ask

What is memory profiling?

Specifically, the Memory Profiler can show you the following about object allocations: What types of objects were allocated and how much space they use. The stack trace of each allocation, including in which thread. When the objects were deallocated (only when using a device with Android 8.0 or higher).

How do you run a memory profiling in Python?

The easiest way to profile a single method or function is the open source memory-profiler package. It's similar to line_profiler , which I've written about before . You can use it by putting the @profile decorator around any function or method and running python -m memory_profiler myscript.


1 Answers

Oops, apparently the answer can be found from https://stat.ethz.ch/R-manual/R-devel/library/utils/html/Rprofmem.html:

The memory profiler slows down R even when not in use, and so is a compile-time option.

like image 146
isomorphismes Avatar answered Sep 23 '22 16:09

isomorphismes