class JvmMemoryDetector extends AbstractDetector {
    @Override
    public String getName() {
        return "jvm";
    }

    @Override
    public Map<String, Object> getInfo() {<FILL_FUNCTION_BODY>}
}

        Map<String, Object> info = new LinkedHashMap<>();

        Runtime run = Runtime.getRuntime();

        long max = run.maxMemory();
        long total = run.totalMemory();
        long free = run.freeMemory();
        long used = total - free;
        long usable = max - used;

        if (max > 0L) {
            float ratio = (float) used * 100.0F / (float) max;
            info.put("ratio", ratio);
        }

        info.put("total", SizeUtil.formatByteSize(total));
        info.put("used", SizeUtil.formatByteSize(used));
        info.put("usable", SizeUtil.formatByteSize(usable));
        info.put("free", SizeUtil.formatByteSize(free));
        return info;
    
<methods>public non-sealed void <init>() <variables>protected static final java.lang.String osName