static long[] getMemoryUsage(String s, int pageSize) throws IOException{
        long[] size = new long[2];
        // statm line: "size rss shared text lib data dt"
        // all values are number of pages, return values from this method are values in bytes
        var statmOutputs = s.split(" ");
        size[memoryTypeVirtual] = Long.parseLong(statmOutputs[0]) * pageSize;
        // Note 1: From man proc_pid_statm man page: rss is the same as VmRSS in /proc/pid/status
        // Note 2: From man proc_pid_status:  VmRSS  Resident set size.  Note that the value here is the sum of RssAnon, RssFile, and  RssShmem.
        // Note 3: 'shared' is RssFile+RssShmem, so subtraction below gives us the same value as RssAnon
        size[memoryTypeResident] = (Long.parseLong(statmOutputs[1]) - Long.parseLong(statmOutputs[2])) * pageSize;

        return size;
    }
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