Package shark

Types

ByteArraySourceProvider
Link copied to clipboard
class ByteArraySourceProvider(byteArray: ByteArray) : DualSourceProvider
ConstantMemoryMetricsDualSourceProvider
Link copied to clipboard
class ConstantMemoryMetricsDualSourceProvider(realSourceProvider: DualSourceProvider) : DualSourceProvider

Captures IO read metrics without using much memory.

FileSourceProvider
Link copied to clipboard
class FileSourceProvider(file: File) : DualSourceProvider
GcRoot
Link copied to clipboard
sealed class GcRoot

A GcRoot as identified by HprofRecord.HeapDumpRecord.GcRootRecord in the heap dump.

Hprof
Link copied to clipboard
class Hprof : Closeable

Hprof is deprecated, and we offer partial backward compatibility. Any code that was previously using HprofReader directly now has to call StreamingHprofReader.readerFor or HprofRandomAcccessReader.readerFor

HprofDeobfuscator
Link copied to clipboard
class HprofDeobfuscator

Converts a Hprof file to another file with deobfuscated class and field names.

HprofHeader
Link copied to clipboard
data class HprofHeader(heapDumpTimestamp: Long, version: HprofVersion, identifierByteSize: Int)

Represents the header metadata of a Hprof file.

HprofPrimitiveArrayStripper
Link copied to clipboard
class HprofPrimitiveArrayStripper

Converts a Hprof file to another file with all primitive arrays replaced with arrays of zeroes, which can be useful to remove PII. Char arrays are handled slightly differently because 0 would be the null character so instead these become arrays of '?'.

HprofReader
Link copied to clipboard
class HprofReader
HprofRecord
Link copied to clipboard
sealed class HprofRecord

A Hprof record. These data structure map 1:1 with how records are written in hprof files.

HprofRecordReader
Link copied to clipboard
class HprofRecordReader

Reads hprof content from an Okio BufferedSource.

HprofRecordTag
Link copied to clipboard
enum HprofRecordTag : Enum<HprofRecordTag>
HprofVersion
Link copied to clipboard
enum HprofVersion : Enum<HprofVersion>

Supported hprof versions

HprofWriter
Link copied to clipboard
class HprofWriter : Closeable

Generates Hprof files.

OnHprofRecordListener
Link copied to clipboard
fun interface OnHprofRecordListener

Listener passed in to StreamingHprofReader.readRecords, gets notified for each HprofRecord found in the heap dump which types is in the set of the recordTypes parameter passed to StreamingHprofReader.readRecords.

OnHprofRecordTagListener
Link copied to clipboard
fun interface OnHprofRecordTagListener

Listener passed in to StreamingHprofReader.readRecords, gets notified for each HprofRecordTag found in the heap dump.

PrimitiveType
Link copied to clipboard
enum PrimitiveType : Enum<PrimitiveType>

A primitive type in the prof.

ProguardMapping
Link copied to clipboard
class ProguardMapping
ProguardMappingReader
Link copied to clipboard
class ProguardMappingReader(proguardMappingInputStream: InputStream)
RandomAccessHprofReader
Link copied to clipboard
class RandomAccessHprofReader : Closeable

Reads records in a Hprof source, one at a time with a specific position and size. Call openReaderFor to obtain a new instance.

RandomAccessSource
Link copied to clipboard
interface RandomAccessSource : Closeable
RandomAccessSourceProvider
Link copied to clipboard
fun interface RandomAccessSourceProvider

Can open RandomAccessSource instances.

StreamingHprofReader
Link copied to clipboard
class StreamingHprofReader

Reads the entire content of a Hprof source in one fell swoop. Call readerFor to obtain a new instance.

StreamingRecordReaderAdapter
Link copied to clipboard
class StreamingRecordReaderAdapter(streamingHprofReader: StreamingHprofReader)

Wraps a StreamingHprofReader to provide a higher level API that streams HprofRecord instances.

StreamingSourceProvider
Link copied to clipboard
fun interface StreamingSourceProvider

Can open Source instances.

ThrowingCancelableFileSourceProvider
Link copied to clipboard
class ThrowingCancelableFileSourceProvider(file: File, throwIfCanceled: Runnable) : DualSourceProvider

A DualSourceProvider that invokes throwIfCanceled before every read, allowing cancellation of IO based work built on top by throwing an exception.

ValueHolder
Link copied to clipboard
sealed class ValueHolder

A value in the heap dump, which can be a ReferenceHolder or a primitive type.