uobjnew(8)

πŸ“¦
version 0.36.1 Β· 2 versions
, in alpine 3.24, nixpkgs unstable

πŸ’– uobjnew(8) πŸ’–

okay so bestie, welcome to the System Manager's Manual corner πŸ’… this page is all about uobjnew and its whole friend group: cobjnew, javaobjnew, rubyobjnew, and tclobjnew. Their job? Summarizing object allocations in high-level languages. iconic behavior, honestly.


✨ NAME ✨

uobjnew, cobjnew, javaobjnew, rubyobjnew, tclobjnew β€” summarize object allocations in high-level languages. no cap, that's the whole vibe 🫢


πŸŽ€ SYNOPSIS πŸŽ€

cobjnew [-h] [-C TOP_COUNT] [-S TOP_SIZE] [-v] pid [interval]
javaobjnew [-h] [-C TOP_COUNT] [-S TOP_SIZE] [-v] pid [interval]
rubyobjnew [-h] [-C TOP_COUNT] [-S TOP_SIZE] [-v] pid [interval]
tclobjnew [-h] [-C TOP_COUNT] [-S TOP_SIZE] [-v] pid [interval]
uobjnew [-h] [-C TOP_COUNT] [-S TOP_SIZE] [-v] [-l {c,java,ruby,tcl}]
pid [interval]

🌸 DESCRIPTION 🌸

okay so here's the tea: uobjnew traces object allocations in high-level languages β€” including "malloc" β€” and prints summaries of the most frequently allocated types, sorted by number of objects or by number of bytes. it's giving β€œallocation receipts” πŸ’…

This tool relies on USDT probes embedded in many high-level languages, such as C, Java, Ruby, and Tcl. It requires a runtime instrumented with these probes, which in some cases requires building from source with a USDT-specific flag, such as --enable-dtrace or --with-dtrace. For Java, the Java process must be started with the -XX:+ExtendedDTraceProbes flag. yes bestie, that flag matters 😭

Since this uses BPF, only the root user can use this tool. root-only, no exceptions, periodt πŸ‘‘


πŸ¦‹ REQUIREMENTS πŸ¦‹

vibe check: you need CONFIG_BPF and bcc. that's the entry fee ✨


πŸ’œ OPTIONS πŸ’œ

  • -C TOP_COUNT β€” print the top object types sorted by number of instances.
  • -S TOP_SIZE β€” print the top object types sorted by size.
  • -v β€” print the resulting BPF program, for debugging purposes.
  • {c,java,ruby,tcl} β€” the language to trace.
  • pid β€” the process id to trace.
  • interval β€” wait this many seconds and then print the summary and exit. by default, it waits for Ctrl+C to exit.

🌈 EXAMPLES 🌈

Trace object allocations in a Ruby process:

# uobjnew ruby 148

Trace object allocations from "malloc" and print the top 10 by total size:

# uobjnew -S 10 c 1788

πŸ“ FIELDS πŸ“

  • TYPE β€” the object type being allocated. For C (malloc), this is the block size.
  • ALLOCS β€” the number of objects allocated.
  • BYTES β€” the number of bytes allocated.

πŸ”₯ OVERHEAD πŸ”₯

Object allocation events are quite frequent, and therefore the overhead from running this tool can be considerable. use with caution and make sure to test before using in a production environment, bestie β€” fr fr, do not just raw-dog this in prod πŸ™ˆ

Nonetheless, even thousands of allocations per second will likely produce a reasonable overhead when investigating a problem. so yeah, it can still be useful, just be mindful πŸ’€


πŸ‘‘ SOURCE πŸ‘‘

This is from bcc.

https://github.com/iovisor/bcc

Also look in the bcc distribution for a companion _example.txt file containing example usage, output, and commentary for this tool. it's giving bonus lore πŸŽ€


⭐ OS ⭐

Linux


πŸ’… STABILITY πŸ’…

Unstable β€” in development. she's still cooking, bestie 🫢


🌸 AUTHOR 🌸

Sasha Goldshtein


🧚 SEE ALSO 🧚

ustat(8), ugc(8), memleak(8)


okay bye bestie πŸ’– this page is filed under USER COMMANDS, dated 2018-10-09, and it's the uobjnew(8) page β€” slay and stay safe ✨

πŸ“¦ where this page comes from