I'm experiencing some RAM-issues with XenServer now and then. The symptoms are that there are warnings in XenCenter that dom0 memory is too low and that this may have an impact on virtual server performance on the corresponding host. Another symptom is that there are cases in which some virtual servers become unreachable.
As a first measure I increased the dom0_memory on all affected host from the default(something about 700 MB RAM? to 2 GB). This helped a bit. But the issue still comes up sometimes.
I suspect possible memory_leak issues within one or another xenserver component. Of course I should upgrade to the latest xenserver major version and install all available patches. Both is not done. My Servers are still at XenServer 6.5 and not all patches are applied. I'm very guarded in applying updates into the XenServers since I do not want trouble with XenServer-Versions that aren't working as well as expected. I got more than enough of that experience so far.
My current solution is to check the free memory and do some cache_cleanup if the free memory becomes low. I'm clear that this a very simple workaround. Currently I'm watching the situation and my first impression is, that it helps with my special problem.
Here are the scripts, I applied: