title: How to free Ubuntu memory once python script is stopped from terminal (Ctrl-C)?
body: <p>I was calling a python script (2.7) from a console (Ubuntu 14.04) using a command: <em>python script_name.py</em>. At some point, I wanted to stop the running script by pressing Ctrl-C. However, when I checked Ubuntu System Monitor, the memory used by the python script was not freed up (I monitored Ubuntu System Monitor before I called the script, during the process, and after I pressed Ctrl-C to stop the script). I tried to free up the memory using a command explained on <a href="http://www.upubuntu.com/2013/01/how-to-free-up-unused-memory-in.html" rel="nofollow noreferrer">http://www.upubuntu.com/2013/01/how-to-free-up-unused-memory-in.html</a> , but didn't work (I mean, the memory usage was not changed).</p>
  
  <p>However, if I used pycharm to run and stop the script, the memory was freed up directly once I pressed the Stop button. For some reasons (such as from ssh or just to test from console), I want to run my script from the console (without using pycharm or any other IDEs).</p>
  
  <p>My question is, what is the command, or how to stop running python script and free up directly the memory used by the script, if I run the script from the console?</p>
  
  <p>Many thanks in advance.</p>