public static long getFreeMemory() {
        ActivityManager am = (ActivityManager) BlockCanaryInternals.getContext().provideContext().getSystemService(Context.ACTIVITY_SERVICE);
        ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
        am.getMemoryInfo(mi);
        return mi.availMem / 1024;
    }
Get cpu core number

@return int cpu core number
blockcanary-analyzer/src/main/java/com/github/moduth/blockcanary/internal/PerformanceUtils.java