Here are several method to diagnose and maybe identify a fix. Check the memory usage then identify the process causing the extreme usage. Next, work on that process configuration.
Check memory usageDisplay available and used memory with 'free' command
# free -m
Press m to display memory
Press Shift + m to sort by memory percentage
Press R to reverse the sort
List processes and amount of memory being used
# ps -e -o pid,vsz,comm=
Check the process
Where 1234 is an example of the process id (pid).