Example usage for java.lang System gc

List of usage examples for java.lang System gc

Introduction

In this page you can find the example usage for java.lang System gc.

Prototype

public static void gc() 

Source Link

Document

Runs the garbage collector in the Java Virtual Machine.

Usage

From source file:Main.java

private static BitmapFactory.Options getBitmapOption(int inSampleSize) {
    System.gc();
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inPurgeable = true;/* w  w w .  ja  va2 s .  c  om*/
    options.inSampleSize = inSampleSize;
    return options;
}

From source file:Main.java

public static void releaseMemGc() {
    if ((Runtime.getRuntime().freeMemory() / Runtime.getRuntime().totalMemory()) > 0.7)
        System.gc();
}

From source file:Main.java

public static void recycleBitmapWithGc(Bitmap bitmap) {
    recycleBitmap(bitmap);
    System.gc();
}

From source file:Main.java

public static void BitmapRecyle(Bitmap bitmap) {
    bitmap.recycle();
    bitmap = null;
    System.gc();
}

From source file:Main.java

public static void recycleBitmap(Bitmap bitmap) {
    if (bitmap != null) {
        bitmap.recycle();
        System.gc();
    }
}

From source file:Main.java

public static void recycleBitmap(Bitmap bm) {
    if (bm != null) {
        bm.recycle();
        bm = null;
        System.gc();
    }
}

From source file:Main.java

public static void recycleBitmap(Bitmap bitmap) {
    if (bitmap != null && !bitmap.isRecycled()) {
        bitmap.recycle();/*from w ww  .  j  a va 2s  .  c o  m*/
        System.gc();
    }
}

From source file:Main.java

public static void recyleBitmap(Bitmap bitmap) {
    if (bitmap != null && !bitmap.isRecycled()) {
        bitmap.recycle();
        System.gc();
    }
}

From source file:Main.java

public static void recycle(Bitmap bitmap) {
    if (null != bitmap && !bitmap.isRecycled())
        bitmap.recycle();//www.  j  a v  a  2 s .  c o  m
    bitmap = null;
    System.gc();
}

From source file:Main.java

/**
 * Recycle a Bitmap resource, but need to set null outside
 */
public static void recycleBitmap(Bitmap bitmap) {
    bitmap.recycle();
    System.gc();
}