Java Memory isMemorySufficient()

Here you can find the source of isMemorySufficient()

Description

is Memory Sufficient

License

Open Source License

Declaration

public static boolean isMemorySufficient() 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean isMemorySufficient() {
        final long maxMemory = ((Runtime.getRuntime().maxMemory() / 1024) / 1024);
        final long freeMemory = ((Runtime.getRuntime().freeMemory() / 1024) / 1024);
        if ((freeMemory) < ((1 * maxMemory) / 100)) {
            return false;
        }/*from w  ww  . j av  a  2 s.  c o m*/
        return true;
    }
}

Related

  1. fillMemory()
  2. isDefaultMemoryCardDrive(String aRoot)
  3. isInMemoryDatabase(final String databasePath)
  4. isMemoryAccess(final String value)
  5. isMemoryData(String metric)
  6. logMemoryStats(String msg)
  7. makeVmMemoryDivisibleBy4(long memory)
  8. measureMemoryBefore()
  9. memory()