public static double availablePhysicalMemorySize() {
        GlobalMemory memory = hal.getMemory();
        double availablePhysicalMemorySize = (memory.getAvailable() + memory.getSwapUsed()) / 1024.0 / 1024 / 1024;

        DecimalFormat df = new DecimalFormat(TWO_DECIMAL);
        df.setRoundingMode(RoundingMode.HALF_UP);
        return Double.parseDouble(df.format(availablePhysicalMemorySize));

    }
get available physical memory size
<p>
Keep 2 decimal

@return available Physical Memory Size, unit: G
larkmidtable-web/larkmt-core/src/main/java/com/larkmt/core/util/OSUtils.java