Debug Debug Class

Definition

Provides various debugging methods for Android applications, including tracing and allocation counts.

[Android.Runtime.Register("android/os/Debug", ApiSince=1, DoNotGenerateAcw=true)]
public sealed class Debug : Java.Lang.Object
type Debug = class
    inherit Object
Inheritance
Attributes

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

ShowClassloader ShowClassloader
ShowFullDetail ShowFullDetail

Flags for printLoadedClasses().

ShowInitialized ShowInitialized
TraceCountAllocs TraceCountAllocs

Flags for startMethodTracing().

Properties

BinderDeathObjectCount BinderDeathObjectCount

Returns the number of death notification links to Binder objects that exist in the current process.

BinderLocalObjectCount BinderLocalObjectCount

Returns the number of active local Binder objects that exist in the current process.

BinderProxyObjectCount BinderProxyObjectCount

Returns the number of references to remote proxy Binder objects that exist in the current process.

BinderReceivedTransactions BinderReceivedTransactions

Returns the number of received transactions from the binder driver.

BinderSentTransactions BinderSentTransactions

Returns the number of sent transactions from this process.

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
GlobalAllocCount GlobalAllocCount

Returns the global count of objects allocated by the runtime between a StartAllocCounting() and StopAllocCounting().

GlobalAllocSize GlobalAllocSize

Returns the global size, in bytes, of objects allocated by the runtime between a StartAllocCounting() and StopAllocCounting().

GlobalClassInitCount GlobalClassInitCount

Returns the number of classes successfully initialized (ie those that executed without throwing an exception) between a StartAllocCounting() and StopAllocCounting().

GlobalClassInitTime GlobalClassInitTime

Returns the time spent successfully initializing classes between a StartAllocCounting() and StopAllocCounting().

GlobalExternalAllocCount GlobalExternalAllocCount

This method exists for compatibility and always returns 0.

GlobalExternalAllocSize GlobalExternalAllocSize

This method exists for compatibility and always returns 0.

GlobalExternalFreedCount GlobalExternalFreedCount

This method exists for compatibility and always returns 0.

GlobalExternalFreedSize GlobalExternalFreedSize

This method exists for compatibility and has no effect.

GlobalFreedCount GlobalFreedCount

Returns the global count of objects freed by the runtime between a StartAllocCounting() and StopAllocCounting().

GlobalFreedSize GlobalFreedSize

Returns the global size, in bytes, of objects freed by the runtime between a StartAllocCounting() and StopAllocCounting().

GlobalGcInvocationCount GlobalGcInvocationCount

Returns the number of non-concurrent GC invocations between a StartAllocCounting() and StopAllocCounting().

Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
IsDebuggerConnected IsDebuggerConnected

Determine if a debugger is currently attached.

JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
LoadedClassCount LoadedClassCount

Get the number of loaded classes.

NativeHeapAllocatedSize NativeHeapAllocatedSize

Returns the amount of allocated memory in the native heap.

NativeHeapFreeSize NativeHeapFreeSize

Returns the amount of free memory in the native heap.

NativeHeapSize NativeHeapSize

Returns the size of the native heap.

PeerReference PeerReference Inherited from Object
Pss Pss

Retrieves the PSS memory used by the process as given by the smaps.

RuntimeStats RuntimeStats
ThreadAllocCount ThreadAllocCount

Returns the thread-local count of objects allocated by the runtime between a StartAllocCounting() and StopAllocCounting().

ThreadAllocSize ThreadAllocSize

Returns the thread-local size of objects allocated by the runtime between a StartAllocCounting() and StopAllocCounting().

ThreadExternalAllocCount ThreadExternalAllocCount

This method exists for compatibility and has no effect.

ThreadExternalAllocSize ThreadExternalAllocSize

This method exists for compatibility and has no effect.

ThreadGcInvocationCount ThreadGcInvocationCount

Returns the number of thread-local non-concurrent GC invocations between a StartAllocCounting() and StopAllocCounting().

ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

ChangeDebugPort(Int32) ChangeDebugPort(Int32)

Change the JDWP port.

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
DumpHprofData(String) DumpHprofData(String)

Dump "hprof" data to the specified file.

DumpHprofDataAsync(String) DumpHprofDataAsync(String)
DumpService(String, FileDescriptor, String[]) DumpService(String, FileDescriptor, String[])

Get a debugging dump of a system service by name.

DumpServiceAsync(String, FileDescriptor, String[]) DumpServiceAsync(String, FileDescriptor, String[])
EnableEmulatorTraceOutput() EnableEmulatorTraceOutput()

Enable "emulator traces", in which information about the current method is made available to the "emulator -trace" feature.

Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetMemoryInfo(Debug+MemoryInfo) GetMemoryInfo(Debug+MemoryInfo)

Retrieves information about this processes memory usages.

GetRuntimeStat(String) GetRuntimeStat(String)
JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
PrintLoadedClasses(DebugShow) PrintLoadedClasses(DebugShow)

Dump a list of all currently loaded class to the log file.

ResetAllCounts() ResetAllCounts()

Clears all the global and thread-local memory allocation counters.

ResetGlobalAllocCount() ResetGlobalAllocCount()

Clears the global count of objects allocated.

ResetGlobalAllocSize() ResetGlobalAllocSize()

Clears the global size of objects allocated.

ResetGlobalClassInitCount() ResetGlobalClassInitCount()

Clears the count of classes initialized.

ResetGlobalClassInitTime() ResetGlobalClassInitTime()

Clears the count of time spent initializing classes.

ResetGlobalExternalAllocCount() ResetGlobalExternalAllocCount()

This method exists for compatibility and has no effect.

ResetGlobalExternalAllocSize() ResetGlobalExternalAllocSize()

This method exists for compatibility and has no effect.

ResetGlobalExternalFreedCount() ResetGlobalExternalFreedCount()

This method exists for compatibility and has no effect.

ResetGlobalExternalFreedSize() ResetGlobalExternalFreedSize()

This method exists for compatibility and has no effect.

ResetGlobalFreedCount() ResetGlobalFreedCount()

Clears the global count of objects freed.

ResetGlobalFreedSize() ResetGlobalFreedSize()

Clears the global size of objects freed.

ResetGlobalGcInvocationCount() ResetGlobalGcInvocationCount()

Clears the count of non-concurrent GC invocations.

ResetThreadAllocCount() ResetThreadAllocCount()

Clears the thread-local count of objects allocated.

ResetThreadAllocSize() ResetThreadAllocSize()

Clears the thread-local count of objects allocated.

ResetThreadExternalAllocCount() ResetThreadExternalAllocCount()

This method exists for compatibility and has no effect.

ResetThreadExternalAllocSize() ResetThreadExternalAllocSize()

This method exists for compatibility and has no effect.

ResetThreadGcInvocationCount() ResetThreadGcInvocationCount()

Clears the thread-local count of non-concurrent GC invocations.

SetAllocationLimit(Int32) SetAllocationLimit(Int32)

Establish an object allocation limit in the current thread.

SetGlobalAllocationLimit(Int32) SetGlobalAllocationLimit(Int32)

Establish a global object allocation limit.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
StartAllocCounting() StartAllocCounting()

Start counting the number and aggregate size of memory allocations.

StartMethodTracing() StartMethodTracing()

Start method tracing with default log name and buffer size.

StartMethodTracing(String) StartMethodTracing(String)

Start method tracing, specifying the trace log file name.

StartMethodTracing(String, Int32) StartMethodTracing(String, Int32)

Start method tracing, specifying the trace log file name and the buffer size.

StartMethodTracing(String, Int32, DebugTraceOptions) StartMethodTracing(String, Int32, DebugTraceOptions)

Start method tracing, specifying the trace log file name and the buffer size.

StartMethodTracingSampling(String, Int32, Int32) StartMethodTracingSampling(String, Int32, Int32)

Start sampling-based method tracing, specifying the trace log file name, the buffer size, and the sampling interval.

StartNativeTracing() StartNativeTracing()

Enable qemu tracing.

StopAllocCounting() StopAllocCounting()

Stop counting the number and aggregate size of memory allocations.

StopMethodTracing() StopMethodTracing()

Stop method tracing.

StopNativeTracing() StopNativeTracing()

Stop qemu tracing.

ThreadCpuTimeNanos() ThreadCpuTimeNanos()

Get an indication of thread CPU usage.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
WaitForDebugger() WaitForDebugger()

Wait until a debugger attaches.

WaitingForDebugger() WaitingForDebugger()

Returns "true" if one or more threads is waiting for a debugger to attach.

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to