What Is RAM in Web Hosting?
RAM in web hosting is the memory your account is allowed to use to run active processes, such as PHP scripts handling a page request or a database executing a query, while they are running. It is different from disk space, which stores files at rest. Shared hosting plans cap RAM per account, usually from a few hundred megabytes to a few gigabytes, while VPS and dedicated servers reserve a fixed, private amount.
RAM vs. disk space: the key distinction
Disk space stores your files, database and email permanently until something deletes them. RAM is temporary working memory used only while a process is actively running, such as a PHP script building a page or MySQL executing a query, and it is cleared the moment that process finishes. A site can have ample free disk space and still run into trouble if too many processes try to use memory at the same time.
How RAM is allocated by hosting type
| Hosting type | How RAM is handled |
|---|---|
| Shared hosting | A per-account memory cap enforced alongside other accounts on the same physical server, often through CloudLinux's LVE |
| VPS | A fixed amount of RAM reserved for your instance alone, typically 1 to 32 GB depending on plan |
| Dedicated server | All of the physical server's RAM, commonly 16 GB to several hundred GB |
| Cloud hosting | RAM that can often be scaled up or down on demand, billed by usage |
What happens when RAM runs out
When a process tries to use more memory than it is allowed, it is typically stopped by the system, often referred to as an out-of-memory (OOM) kill. On a website this usually shows up as a generic 500 Internal Server Error, a blank page, or a specific message such as PHP's "Allowed memory size exhausted" error. Unlike a CPU limit, which throttles and slows things down, a hard memory limit tends to stop the process outright.
Common causes of high RAM usage
- Plugins or themes that load large libraries on every page, even pages that do not need them.
- Image editing or file processing tasks, such as resizing large uploads.
- Database queries that pull large result sets into memory at once.
- Running several memory-heavy applications on the same small VPS.
- Memory leaks in long-running background scripts or cron jobs.
Reducing RAM usage
- Deactivate plugins or modules you are not actively using.
- Set a reasonable PHP
memory_limitand raise it only as far as genuinely needed. - Paginate or limit large database queries instead of loading everything at once.
- Use caching so pages are served from a stored copy instead of being rebuilt in memory on every request.
- Upgrade to a plan or VPS size with more RAM if usage is consistently near the cap.
Frequently asked questions
What is RAM in web hosting used for?
RAM is used to run your website's active processes, such as PHP scripts generating a page or a database executing a query, while they are in progress.
Is RAM the same thing as disk space?
No. Disk space stores files and data permanently, while RAM is temporary working memory used only while a process is actively running.
What happens if my hosting account runs out of RAM?
A process that exceeds its memory allowance is typically stopped, which often appears to visitors as a 500 Internal Server Error or a blank page.
How much RAM does a typical shared hosting account get?
Shared hosting plans commonly cap individual accounts at a few hundred megabytes to around 1 to 2 GB, though this varies widely by provider and plan tier.
Why does my site show a memory exhausted error?
This usually means a PHP script tried to use more memory than the configured limit allows, often caused by a plugin, large file processing, or a query pulling too much data at once.
Does more RAM make a website load faster?
More RAM mainly prevents memory-related errors and allows more processes to run at once; it does not automatically speed up page rendering, which also depends on code efficiency, caching and database performance.
Related topics
- What Is Web Hosting? Hosting Basics
- What Is Disk Space in Hosting? Hosting Basics
- What Is Shared Hosting? Hosting Basics
- What Is a VPS (Virtual Private Server)? VPS & Cloud
- What Is a Dedicated Server? Dedicated Servers