uobjnew(8)
π 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 π§
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
- centos-stream 10: bcc-tools 0.36.1-1.el10 Β· Apache-2.0
- centos-stream 9: bcc-tools 0.36.1-1.el9 Β· ASL 2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms