Java Code Examples for android.os.Debug#stopAllocCounting()

The following examples show how to use android.os.Debug#stopAllocCounting() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BenchmarkStats.java    From ig-json-parser with MIT License 6 votes vote down vote up
/** Grabs the post-snapshot. */
synchronized void after() {
  mAfterTimestamp = SystemClock.elapsedRealtime();
  Debug.stopAllocCounting();
  Debug.getMemoryInfo(mMemoryInfoAfter);

  mAllocCount = Debug.getGlobalAllocCount();
  mAllocSize = Debug.getGlobalAllocSize();
  mFreeCount = Debug.getGlobalFreedCount();
  mFreeSize = Debug.getGlobalFreedSize();

  if (mState != State.BEFORE_CALLED) {
    throw new IllegalStateException("unexpected state");
  }
  mState = State.AFTER_CALLED;
}
 
Example 2
Source File: Instrumentation.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Deprecated
public void stopAllocCounting() {
    Runtime.getRuntime().gc();
    Runtime.getRuntime().runFinalization();
    Runtime.getRuntime().gc();
    Debug.stopAllocCounting();
}
 
Example 3
Source File: Instrumentation.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Deprecated
public void stopAllocCounting() {
    Runtime.getRuntime().gc();
    Runtime.getRuntime().runFinalization();
    Runtime.getRuntime().gc();
    Debug.stopAllocCounting();
}
 
Example 4
Source File: Instrumentation.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Deprecated
public void stopAllocCounting() {
    Runtime.getRuntime().gc();
    Runtime.getRuntime().runFinalization();
    Runtime.getRuntime().gc();
    Debug.stopAllocCounting();
}
 
Example 5
Source File: Instrumentation.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Deprecated
public void stopAllocCounting() {
    Runtime.getRuntime().gc();
    Runtime.getRuntime().runFinalization();
    Runtime.getRuntime().gc();
    Debug.stopAllocCounting();
}
 
Example 6
Source File: Instrumentation.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public void stopAllocCounting() {
    Runtime.getRuntime().gc();
    Runtime.getRuntime().runFinalization();
    Runtime.getRuntime().gc();
    Debug.stopAllocCounting();
}
 
Example 7
Source File: Instrumentation.java    From droidel with Apache License 2.0 4 votes vote down vote up
public void stopAllocCounting() {
    Runtime.getRuntime().gc();
    Runtime.getRuntime().runFinalization();
    Runtime.getRuntime().gc();
    Debug.stopAllocCounting();
}