MemoryProfiling(3)

πŸ“¦
version 6.14 Β· 3 versions
, in fedora 43

πŸ’– MemoryProfiling(3) πŸ’–

okay so this one lives in the User Contributed Perl Documentation corner of your man pages, and bestie, it's a mood board, not a finished manual. Let's get into it. πŸŽ€


✨ Ideas and Plans for Memory Profiling with NYTProf ✨

XXX This is mostly a dumping ground for thoughts, and links at the moment. Somewhere to gather the info so it'll be easier to find when someone wants to work on it.

fr fr it's a notes app page and we're all just living in it.

It's also focussed on runtime profiling of total memory usage over time β€” like, watching the whole process breathe β€” rather than a detailed analysis of who 'owns' what memory as some particular point in time (like the end of the program). iykyk, different vibe entirely.

NYTProf currently only measures time and supports a limited range of "clocks" (realtime vs cputime). For profiling memory we need to add a new kind of "clock" that measures memory usage. Since we're generalizing the concept of what gets measured (and how we get the info from the system), a better name than "clock" would be "probe". πŸ’…

Conjectural terminology, bestie, write this down:

"Probe" means some measuring mechanism like get_clock(), times(), getrusage(),
that may yield multiple pieces of information with a single call.

"Measure" is one specific item generated by a probe.

Probe "time"   uses times(), measures: "time.user", "time.user+sys" etc
Probe "clock"  uses clock_gettime(), measures: "clock.realtime", "clock.monotonic" etc
Probe "rusage" uses getrusage(), measures: "rusage.majflt", "rusage.nvcsw" etc
Probe "memory" measures: "memory.bytes", "mem.allocs" etc
Probe "arena"  measures: "arena.svs", "arena.bytes" etc

Generalize the concepts of probes. Have a structure defining a 'probe' with pointers to functions to get the values, subtract values to get relative ticks, return the tick units etc. Give them names and attributes (cpu, realtime etc). User could then pick a probe by name. By default we'd pick the best available realtime probe. Use the subtraction logic where we currently handle times in the statement and subroutine profilers. ✨


πŸ“§ Email threads πŸ“§


🧚 Possibly Relevant Perl Modules 🧚

Per-process memory information:

http://metacpan.org/pod/Devel::Mallinfo

Arena, stash, and pad based memory reporters:

http://metacpan.org/pod/Devel::Gladiator
http://metacpan.org/release/Internals-DumpArenas/
http://metacpan.org/release/Internals-GraphArenas/
http://metacpan.org/pod/Devel::DumpSizes
http://metacpan.org/pod/Devel::Arena

Per-object memory size reporters:

http://metacpan.org/pod/Devel::Size
http://metacpan.org/pod/Devel::Size::Report

Others:

http://metacpan.org/release/Devel-Memalyzer/
http://metacpan.org/pod/Devel::Memalyzer::Plugin::ProcSmaps

🌈 Other Items of Interest 🌈

  • "Memory Efficient Perl" slides by jjore
http://docs.google.com/present/view?id=dg7kgpct_24cjs3c9fv
http://diotalevi.isa-geek.net/~josh/090402/frontend.png
  • Other profile/memory visualization tools
http://netjam.org/spoon/viz/
http://java.dzone.com/announcements/visualvm-12-great-java

lowkey important: this page is a thoughts-and-links situation, no cap β€” nothing here is a promise of behavior, it's just where the info gets gathered so it's easier to find later. πŸ™ˆ

and that's the whole page, bestie!! this one ships with perl v5.42.0, dated 2025-07-25, and it's page MemoryProfiling(3) in the User Contributed Perl Documentation collection. slay, go build a memory probe, you got this πŸ’œπŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from