if "VmRSS" in line:
mem_usage = line.split(":")[1].strip()
usage, unit = mem_usage.split(" ")
val = int(usage)
// Assume output to be in kB
if unit == "B":
val /= 1000.0
if unit == "mB":
val *= 1e3
if unit == "gB":
val *= 1e6
return val
except:
print("Couldn"t open status file, no index size available.")
return -1
After Change
def get_index_size(self, process):
Returns the size of the index in kB or -1 if not implemented.
return psutil.Process().memory_info().rss / 1024 // return in kB for backwards compatibility
def fit(self, X):
pass