- New feature to export result as JSON to enable further processing (#248).
For now until the memory usage is exported.
./hprof-slurp -i "test-heap-dumps/hprof-64.bin" --top 3 --json
The result is written to a file.
less hprof-slurp.json | grep jq .
{
"top_allocated_classes": [
{
"class_name": "int[]",
"instance_count": 436,
"largest_allocation_bytes": 650016,
"allocation_size_bytes": 2091112
},
{
"class_name": "char[]",
"instance_count": 1991,
"largest_allocation_bytes": 16400,
"allocation_size_bytes": 201842
},
{
"class_name": "byte[]",
"instance_count": 443,
"largest_allocation_bytes": 8208,
"allocation_size_bytes": 87294
}
],
"top_largest_instances": [..]
}