Java Memory Information getDenotationOfJVMMemorySettings(String stringMapJavaOpts)

Here you can find the source of getDenotationOfJVMMemorySettings(String stringMapJavaOpts)

Description

get Denotation Of JVM Memory Settings

License

LGPL

Declaration

private static char getDenotationOfJVMMemorySettings(String stringMapJavaOpts) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    private static char getDenotationOfJVMMemorySettings(String stringMapJavaOpts) {
        int index = -1;
        if (stringMapJavaOpts.lastIndexOf('k') != -1) {
            return 'k';
        } else if (stringMapJavaOpts.lastIndexOf('K') != -1) {
            return 'K';
        } else if ((index = stringMapJavaOpts.lastIndexOf('m')) != -1 && index != 2) {
            return 'm';
        } else if ((index = stringMapJavaOpts.lastIndexOf('M')) != -1) {
            return 'M';
        } else if ((index = stringMapJavaOpts.lastIndexOf('g')) != -1) {
            return 'g';
        } else if ((index = stringMapJavaOpts.lastIndexOf('G')) != -1) {
            return 'G';
        }//from   ww  w . j  a v  a  2 s.  co m
        return (char) -1;
    }
}

Related

  1. getAviableMemoryAsString()
  2. getConsumedMemory(boolean preRunGarbageCollector)
  3. getInMemoryURL(String dbName)
  4. getJavaMemorySize(String string)
  5. getJVMMemoryMB()
  6. getMemory()