<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Using Pickle to manage memory in Python
Author
Step1:  Function to track memory utilization
Step2:  Create a dataframe with random integers between 0 and 1000
Step3:  Create Pickle dump
Step4:  Remove the variable from memory
Step5:  Restore the variable from disk
<ASSISTANT_TASK:>
Python Code:
import gc
import pickle
import psutil
import numpy as np
import pandas as pd
Explanation: Using Pickle to manage memory in Python
Author: Dr. Rahul Remanan, CEO, Moad Computer
Run this notebook in Google Colab
Import dependencies
End of explanation
def memory_utilization():
  print('Current memory utilization: {}% ...'.format(psutil.virtual_memory().percent))
Explanation: Function to track memory utilization
End of explanation
memory_utilization()
var=pd.DataFrame(np.random.randint(0,1000,size=(int(2.5e8),2)),columns=['var1','var2'])
print(var.head())
memory_utilization()
Explanation: Create a dataframe with random integers between 0 and 1000
End of explanation
pickle.dump(var,open('var.pkl','wb'))
memory_utilization()
Explanation: Create Pickle dump
End of explanation
del var
_=gc.collect()
memory_utilization()
Explanation: Remove the variable from memory
End of explanation
var=pickle.load(open('var.pkl','rb'))
memory_utilization()
print(var.head())
Explanation: Restore the variable from disk
End of explanation
<END_TASK>