-
Notifications
You must be signed in to change notification settings - Fork 0
Running
Trilby accepts several command-line options followed by a heap dump filename. Unless otherwise noted, Trilby runs an interactive session; see Queries for description of interactive commands. The most common command lines are
# For small heaps
% trilby heapfile.hprof
# For large heaps (set heap max roughly == dump size)
% trilby -Xmx10g --g1 --info heapfile.hprof
Start a non-interactive session to generate a small heap file usable for functional testing and demos. Example:
% trilby --genheap
Generating smallheap.hprof with 10000 test objects
Ready to dump, sleeping
Dumping heap to /tmp/trilby/smallheap.hprof ...
Heap dump file created
Killing GenHeap & waiting
Done with smallheap.hprof
A synonym for -XX:+UseG1GC. May be helpful for larger heaps, since the CMS (the default for Trilby) does not take kindly to allocation of massive arrays. (ParallelScavenge is neither recommended nor supported; the compaction time for large heaps is prohibitive.)
Start a non-interactive session and simply generate a histogram a la jmap --histo (except that Trilby histograms also display retained sizes.) Example:
% trilby --histo smallheap.hprof | head -5
40738 651808 651808 java.lang.Integer
12022 480880 1087832 java.util.HashMap$Entry
30000 480000 480000 trilby.util.Thing2
10704 342528 276888 java.lang.String
10000 320000 480000 trilby.util.Thing2[]
Turns on INFO-level logging, which will output a variety of status information as Trilby reads the heap and processes queries.
Don't generate the dominator tree. This saves considerable startup time on large heaps, but precludes dominator queries or display of retained sizes.
(Experimental, may be removed.) Move certain large structures into direct byte buffers instead of allocating them on the heap. This option may be helpful if raising the max heap size doesn't resolve an out-of-memory error.
Any option that begins with a single dash is passed as-is to the JVM. For example, you can set the max heap size with -Xmx.