Warning: session_start(): open(/var/lib/php/sessions/sess_f21l83uancurt4gl0ke26t7djk, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
set flag LeanMode.
set flag l_withoutReflection.
set flag NoAutoGunzip.
do not include function get.
sbool linux_rssFixedForZGC_verbose;
static long linux_rssFixedForZGC() {
ret linux_rssFixedForZGC(processID_int());
}
static long linux_rssFixedForZGC(int pid) {
if (!is64BitLinux()) fail("Not on 64 Bit Linux");
S range = null;
new TreeMap rssByRange;
Pattern patAddr = Pattern.compile("^([0-9a-f]{1,16})-");
temp BufferedReader in = utf8bufferedReader("/proc/" + pid + "/smaps");
S s;
while ((s = in.readLine()) != null) {
Matcher m = patAddr.matcher(s);
S addr = m.find() ? m.group(1) : null;
if (addr != null) {
addr = lpad(addr, 16, '0');
//print("Have address: " + addr);
S cleanedAddr = longToHex(parseUnsignedHexLong(addr) & ~((1L << 42)-1));
range = takeFirst_string(6, cleanedAddr);
continue;
} // else print("Not range: " + s);
PairS p = parseColonProperty(s);
if (eqic(pairA(p), "rss")) {
long size = Long.parseLong(beforeSpace(p.b));
if (size != 0)
rssByRange.put(range, getOrCreate_long(rssByRange, range) + size);
}
}
if (linux_rssFixedForZGC_verbose)
for (Map.Entry e : rssByRange.entrySet()) {
System.out.println("Address range " + rpad(e.getKey(), 16, 'x') + ": " + toK(e.getValue()) + " MB");
}
Long min = null;
for (S _range : ll("000004", "000008", "000010", "00007c")) {
Long l = rssByRange.get(_range);
if (l != null) min = min == null ? l : Math.min(min, l);
}
long total = 0;
for (long l : rssByRange.values()) total += l;
long guess = min == null ? total : total-min*3;
ret guess*1024;
}