static long[] getMemoryUsage(VespaService service, int pageSize) {
        String s;
        int pid = service.getPid();

        try {
            s = Files.readString(Path.of("/proc/" + pid + "/statm"));
        } catch (IOException ex) {
            service.setAlive(false);
            return new long[2];
        }
        try {
            return getMemoryUsage(s, pageSize);
        } catch (IOException ex) {
            log.log(Level.FINE, "Unable to read line from statm file", ex);
            return new long[2];
        }
    }
Return memory usage in bytes for a given process, both resident and virtual is
returned.

@param service The instance to get memory usage for
@return array[0] = memoryResident, array[1] = memoryVirtual (both in bytes)
metrics-proxy/src/main/java/ai/vespa/metricsproxy/service/SystemPoller.java