Just for experiment, and Fun... I am trying to create an app that can \"Purposely\" consume RAM as much as we specify immediately. e.g. I want to consume 512 MB RAM, then the ap
You can allocate a huge amount of ram by executing :
while True:
for i in range(0,100000000):
Gig = 1024*1024*1024*2#A Gig multiplied by 2
a = 787878788888888888888888888888 * (i * Gig)
a = a * i
print str(a)*2
I found this code freezing my pc in 5 minutes
Save it in a .pyw for background ram allocation
If it doesn't freeze your pc try increasing the a's value
To stop it quickly,Save this code in a .py file:
#First we send signals
os.system("TASKKILL /im pythonw.exe")
os.system("TASKKILL /im python.exe")
print "Forcefull termination"
#Now we forcefully terminate
#pythonw.exe if running in idle or background
os.system("TASKKILL /im python.exe /f")
os.system("TASKKILL /im pythonw.exe /f")
os.system("pause")