Package shark

Types

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

Captures IO read metrics without using much memory.

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

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

Link copied to clipboard
class HprofDeobfuscator

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

Link copied to clipboard
data class HprofHeader(    val heapDumpTimestamp: Long = System.currentTimeMillis(),     val version: HprofVersion = HprofVersion.ANDROID,     val identifierByteSize: Int = 4)

Represents the header metadata of a Hprof file.

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 '?'.

Link copied to clipboard
sealed class HprofRecord

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

Link copied to clipboard
class HprofRecordReader

Reads hprof content from an Okio BufferedSource.

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

Supported hprof versions

Link copied to clipboard
class HprofWriter : Closeable

Generates Hprof files.

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.

Link copied to clipboard
fun interface OnHprofRecordTagListener

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

Link copied to clipboard
enum PrimitiveType : Enum<PrimitiveType>

A primitive type in the prof.

Link copied to clipboard
class ProguardMapping
Link copied to clipboard
class ProguardMappingReader(proguardMappingInputStream: InputStream)
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.

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

Can open RandomAccessSource instances.

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.

Link copied to clipboard
class StreamingRecordReaderAdapter(streamingHprofReader: StreamingHprofReader)

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

Link copied to clipboard
fun interface StreamingSourceProvider

Can open Source instances.

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.

Link copied to clipboard
sealed class ValueHolder

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