1MemoryProfiling(3)    User Contributed Perl Documentation   MemoryProfiling(3)
2
3
4

Ideas and Plans for Memory Profiling with NYTProf

6       XXX This mostly a dumping ground for thoughts, and links at the moment.
7       Somewhere to gather the info so it'll be easier to find when someone
8       wants to work on it.
9
10       It's also focussed on runtime profiling of total memory usage over time
11       (rather than a detailed analysis of who 'owns' what memory as some
12       particular point in time, like the end of the program).
13
14       NYTProf currently only measures time and supports a limited range of
15       "clocks" (realtime vs cputime). For profiling memory we need to add a
16       new kind of "clock" that measures memory usage. Since we're
17       generalizing the concept of what gets measured (and how we get the info
18       from the system) a better name than "clock" would be "probe".
19
20       Conjectural terminology:
21
22           "Probe" means some measuring mechanism like get_clock(), times(), getrusage(),
23           that may yield multiple pieces of information with a single call.
24
25           "Measure" is one specific item generated by a probe.
26
27           Probe "time"   uses times(), measures: "time.user", "time.user+sys" etc
28           Probe "clock"  uses clock_gettime(), measures: "clock.realtime", "clock.monotonic" etc
29           Probe "rusage" uses getrusage(), measures: "rusage.majflt", "rusage.nvcsw" etc
30           Probe "memory" measures: "memory.bytes", "mem.allocs" etc
31           Probe "arena"  measures: "arena.svs", "arena.bytes" etc
32
33       Generalize the concepts of probes. Have a structure defining a 'probe'
34       with pointers to functions to get the values, subtract values to get
35       relative ticks, return the tick units etc. Give them names and
36       attributes (cpu, realtime etc).  User could then pick a probe by name.
37       By default we'd pick the best available realtime probe.  Use the
38       subtraction logic where we currently handle times in the statement and
39       subroutine profilers.
40

Email threads

42       "Memory profiling in Devel::NYTProf?: - June 2009
43       http://groups.google.com/group/develnytprof-dev/browse_frm/thread/1df4cba3001cd4e4/136812b44e9f7631
44       Talking about the problems of measuring memory usage of the whole
45       process re:
46       http://blog.robin.smidsrod.no/index.php/2009/05/26/memory-footprint-of-popular-cpan-modules
47
48       "Memory profiling possibilities in NYTProf" - September 2009
49       http://groups.google.com/group/develnytprof-dev/browse_frm/thread/c711c132216a3cea/035012e3dc2971ec
50       This includes a detailed overview of the issues.
51
52       "profiling memory" - Dec 2009
53       http://groups.google.com/group/develnytprof-dev/browse_frm/thread/5ffd24200866b0c1/201b58c18d826aaa
54       Nicholas Clark offers an experimental patch that intercepts malloc and
55       free and makes NYTProf measure memory usage.
56

Possibly Relevant Perl Modules

58       Per-process memory information:
59
60           http://metacpan.org/pod/Devel::Mallinfo
61
62       Arena, stash, and pad based memory reporters:
63
64           http://metacpan.org/pod/Devel::Gladiator
65           http://metacpan.org/release/Internals-DumpArenas/
66           http://metacpan.org/release/Internals-GraphArenas/
67           http://metacpan.org/pod/Devel::DumpSizes
68           http://metacpan.org/pod/Devel::Arena
69
70       Per-object memory size reporters:
71
72           http://metacpan.org/pod/Devel::Size
73           http://metacpan.org/pod/Devel::Size::Report
74
75       Others:
76
77           http://metacpan.org/release/Devel-Memalyzer/
78           http://metacpan.org/pod/Devel::Memalyzer::Plugin::ProcSmaps
79

Other Items of Interest

81       "Memory Efficient Perl" slides by jjore
82
83           http://docs.google.com/present/view?id=dg7kgpct_24cjs3c9fv
84           http://diotalevi.isa-geek.net/~josh/090402/frontend.png
85
86       Other profile/memory visualization tools
87
88           http://netjam.org/spoon/viz/
89           http://java.dzone.com/announcements/visualvm-12-great-java
90
91       http://blogs.perl.org/users/alex_balhatchet/2012/01/debugging-memory-use-in-perl---help.html
92
93       http://stackoverflow.com/questions/8715611/can-i-use-dtrace-on-os-x-10-5-to-determine-which-of-my-perl-subs-is-causing-the
94
95
96
97perl v5.34.0                      2022-01-21                MemoryProfiling(3)
Impressum