Sign in

Get free memory percentage

There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.

Calculate the percentage of the free memory and if it is below a threshold, create an alert.

mem_lines = freeoutput.split('\n') mem_line = [x for x in mem_lines if 'Mem:' in x][0] total_mem = float(mem_line.split()[1]) free_mem = float(mem_line.split()[3]) free_mem_perc = free_mem*100/total_mem print(free_mem_perc)
copied