Java Number Percentage Format getPercentMemUse()

Here you can find the source of getPercentMemUse()

Description

get Percent Mem Use

License

Open Source License

Declaration

public static String getPercentMemUse() 

Method Source Code

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

import java.text.NumberFormat;

public class Main {
    private static Runtime runtime = Runtime.getRuntime();
    private static NumberFormat format = NumberFormat.getInstance();

    public static String getPercentMemUse() {
        return format.format(((float) runtime.totalMemory() / (float) runtime.maxMemory()) * 100);
    }/*from   w  w w  .j  ava  2 s .com*/
}

Related

  1. getPercent(long l1, long l2)
  2. getPercent(long val1, long val2)
  3. getPercentFormatter()
  4. getPercentileWithSuffix(double percentile)
  5. getPercentileWithSuffix(double percentile)
  6. getPercentNumber(double num, int scale)
  7. getPercentString(double numerator, double denominator)
  8. getPercentValue(double value)
  9. getPercentWidth(int iColspan, int iMaxTd)