Suddenly error='Cannot allocate memory' (errno=12) [closed]

Your log sais that when the application is crashing, there is 224852k memory free:

Memory: 4k page, physical 1027040k(224852k free), swap 0k(0k free)

Also I see that you have no swap partition added. It's obvious that your system starves of memory. So you have to increase physical memory or add swap space.

To add swap space while the system runs, create a partition, marked as Linux Swap. That the partition id 82. Then use that command to set up the partition as a swap area:

mkswap /dev/sda4

Where /dev/sda4, is the device file.

To activate the partition use:

swapon /dev/sda4

After that you should see SwapTotal and SwapFree in /proc/meminfo.

To make this permanent add a line like this in /etc/fstab:

/dev/sda4               swap                    swap    defaults        0 0