Overview
This article provides the steps to follow when you get the error "Unexpected Error: (12, 'Cannot allocate memory') Details..." after a memory upgrade.
Solution
The server should be reinstalled since it is currently not allocating memory to system processes from the available physical memory, even after increasing it.
Workaround
If the server cannot be upgraded, as a temporary solution, you can follow the steps below:
- SSH to the management IP.
- Change to the root user.
- Create a large file (e.g., for 6GB).
dd if=/dev/zero of=/opt/swapfile bs=1M count=6144
- Change the file access, so that only the root has access.
chmod 0600 /opt/swapfile
- Format as swap.
mkswap /opt/swapfile
- Announce to the system.
swapon /opt/swapfile
- Check the swap file has been correctly created.
ls -al /opt
total 6297672
drwxr-xr-x 12 root root 4096 2019-11-26 17:42 .
drwxr-xr-x 26 root root 4096 2019-11-24 19:23 ..
drwx------ 2 root root 16384 2014-08-13 14:47 lost+found
drwxr-xr-x 5 root root 4096 2019-08-19 05:57 lsi
drwxr-xr-x 3 root root 4096 2019-08-17 16:00 MegaRAID
drwxr-xr-x 15 root root 4096 2019-08-27 14:28 pang
drwxr-xr-x 3 root root 4096 2019-08-17 15:56 patches
-rw-r--r-- 1 root root 6442450944 2019-11-26 17:42 swapfile
- Check the memory available in the system which should show the swap added.
free -m
total used free shared buffers cached
Mem: 127871 28521 99349 0 630 8981
-/+ buffers/cache: 18909 108961
Swap: 6143 0 6143
- Check the swap file available in the system.
swapon -s
Filename Type Size Used Priority
/opt/swapfile file 6291448 0 -1
- Insert the following line in
/etc/fstab
to enable the swap file after a reboot.
/opt/swapfile none swap sw 0 0
- Make sure the line was added.
grep swapfile /etc/fstab
/opt/swapfile none swap sw 0 0
- Restart UBview service.
/etc/init.d/ubview restart