Java Memory Free freeMemory()

Here you can find the source of freeMemory()

Description

free Memory

License

Open Source License

Declaration

public static void freeMemory() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static void freeMemory() {

        try {/*from  w w w.j a v  a  2 s  .  c  om*/
            System.gc();
            System.gc();
            Thread.currentThread().sleep(250);
            System.runFinalization();
            System.runFinalization();
            Thread.currentThread().sleep(250);
            System.gc();
            System.gc();
        } catch (Exception e) {
        }

    }
}

Related

  1. belowMemoryLimit(int percentFree)
  2. checkFreeMemory(long requiredMemory)
  3. formatMemorySize(Long afreeDiskSpace)
  4. freeAllocatedMemory()
  5. freeMemory()
  6. freeMemory()
  7. freeMemory()
  8. freeMemory()
  9. freeMemorym()