Yes. That was because lack of memory. The issue was fixed after I created a 1GB swap file.
how to create a swapfile