Checking Memory Usage On Virtuozzo
To check the memory usage on Virtuozzo, you can either login to the VZPP and check the privvmpages in the QoS Alerts or login via SSH and copy/paste the following command:
awk ‘/privvmpages/ {print “Used “$3/256″M out of “$4/256″M burst “}’ /proc/user_beancounters
Which will give output something similar to this:
Used 191.012M out of 1024M burst
How Memory Limits Work on Virtuozzo and OpenVZ
On container-based VPS platforms, memory is controlled by resource limits called beancounters. Tools such as free -m may show numbers that do not match what your container is actually allowed to use, so the beancounters file is the reliable place to look.
How to Check Your Usage
cat /proc/user_beancountersFocus on these rows and on the failcnt column on the right. Any value above zero means a limit was hit and a request was refused.
- privvmpages: the maximum memory your processes can allocate.
- oomguarpages: memory guaranteed to you before the out-of-memory killer may stop processes.
- vmguarpages: memory you are guaranteed to be able to allocate.
- numproc: the number of processes you can run.
Signs You Are Running Out of Memory
- Services such as MySQL or Apache stop unexpectedly.
- Errors such as “Cannot allocate memory” or “fork: retry”.
- Rising failcnt values for privvmpages or oomguarpages.
- Websites slow down or return 500 or 503 errors under load.
Practical Ways to Reduce Memory Usage
- Tune MySQL or MariaDB: lower buffer sizes and disable unused storage engines.
- Limit web server workers: reduce Apache MaxRequestWorkers or use PHP-FPM with sensible child limits.
- Stop unused services: disable mail, FTP or monitoring tools you do not need.
- Add caching: page and object caching reduce PHP and database work.
- Find heavy processes: use
toporps aux --sort=-%mem | head.
When to Upgrade
If you have already tuned the stack and failcnt keeps rising, the plan is too small. Move to a plan with more RAM, or to a KVM VPS where memory is fully reserved. Read our guide to choosing the best VPS hosting to compare options.
Frequently Asked Questions
Why does free -m show different numbers?
Containers report host-level or virtualized values, so use /proc/user_beancounters for the real limits.
Does a failcnt above zero always mean trouble?
It means a limit was hit at least once. Watch whether it keeps increasing during normal use.
Is KVM easier to manage for memory?
Yes. A KVM VPS reserves RAM for you, so free -m reflects reality. See VPS vs dedicated server if you need even more headroom.
Pro Tips and Best Practices
Measure before you tune
Record failcnt values and memory use over a few days to see real patterns before changing settings.
Tune the database first
MySQL is often the largest memory user. Right-size buffers to your actual data.
Cache aggressively
Page and object caching cut PHP and database work, which cuts memory.
Limit background jobs
Cron jobs and backups that overlap can spike memory. Stagger them.
Check for memory leaks
A process whose memory keeps growing needs a restart schedule or an update.
Choose the right virtualization
If limits keep biting, a KVM plan with reserved RAM removes beancounter guesswork.
Related Guides and Next Steps
Explore more help in our hosting blog, compare our best VPS hosting plans, or contact our team if you would like help applying these steps on your server.