How much RAM does a Discord bot need?
The short answer: a small bot gets by with 256 MB, a big one needs 512 MB to 1 GB. The long answer depends on how many servers and members your bot sees and how much of that it keeps in memory. Here is how to find out and bring it down.
What we measured
We measured how much memory a bot takes once the library is loaded and the client is created, but before it connects to Discord. That is the floor no bot gets below.
| Runtime and library | Memory used (RSS) |
|---|---|
| Node.js 22 without a library | about 36 MB |
| Node.js 22 with discord.js 14.28 | about 77 MB |
| Python 3.13 without a library | about 11 MB |
| Python 3.13 with discord.py 2.7 | about 51 MB |
Measured in November 2026 on Linux. With the connection to Discord, the cache and your own code’s data come on top.
What fills the memory
A bot keeps a lot in its cache so it does not have to ask Discord about every little thing: servers, channels, roles, members, messages. How much of that piles up depends on three things:
- The number of servers and members. A bot on one server with 200 people stores little. A bot on 300 servers with 100,000 members in total stores much more.
- The intents. With the members intent your bot receives events about every member and keeps many of them in memory. With the messages intent, the latest messages of every channel come on top.
- Your own code. Lists that grow and are never emptied are the most common reason for a bot that needs more and more memory after a few days.
Guidelines
| Bot | Memory |
|---|---|
| Moderation, roles, welcomes on a few servers | 256 MB |
| Bot with database, levels and dashboard data | 256 to 512 MB |
| Music or image processing | 512 MB to 1 GB |
| Public bot on hundreds of servers | 1 GB and more, with cache limits |
On EStage you buy memory and split it across your services. A 2 GB plan holds, for example, three small bots, an overlay and a database.
Measuring it yourself
The EStage dashboard shows the memory history of every service. To know from within your code:
// discord.js
setInterval(() => {
const mb = process.memoryUsage().rss / 1024 / 1024;
console.log(`Memory: ${mb.toFixed(0)} MB`);
}, 10 * 60 * 1000);
# discord.py, on Linux
def rss_mb() -> float:
with open("/proc/self/status") as f:
for line in f:
if line.startswith("VmRSS:"):
return int(line.split()[1]) / 1024
return 0.0
What matters is the trend over days, not a single value. If memory rises without end, your code holds on to data somewhere.
Saving memory with discord.js
Ask only for the intents you really need, and limit the cache:
import { Client, GatewayIntentBits, Options } from 'discord.js';
const client = new Client({
intents: [GatewayIntentBits.Guilds],
makeCache: Options.cacheWithLimits({
...Options.DefaultMakeCacheSettings,
MessageManager: 50,
GuildMemberManager: { maxSize: 200, keepOverLimit: (m) => m.id === m.client.user.id },
}),
sweepers: {
...Options.DefaultSweeperSettings,
messages: { interval: 3600, lifetime: 1800 },
},
});
If Node.js runs with a fixed memory limit, set the limit for JavaScript memory a little below it, so Node.js cleans up earlier instead of being ended by the system. At 256 MB, for example:
node --max-old-space-size=192 index.js
Saving memory with discord.py
import discord
client = discord.Client(
intents=discord.Intents.default(),
max_messages=None, # no messages in the cache
member_cache_flags=discord.MemberCacheFlags.none(), # no members in the cache
chunk_guilds_at_startup=False, # do not load members at startup
)
If you do need members, fetch them when you need them instead of keeping all of them in memory.
In short
Start with 256 MB, watch the history for a week and adjust then. If it gets tight, a look at intents and the cache usually helps first, before you assign more memory.
Common questions
Is 128 MB enough for a Discord bot?
For a very small Python bot on a single server sometimes; for discord.js hardly: Node.js with discord.js loaded takes about 75 MB before logging in. Plan 256 MB and you have room.
What happens if my bot needs more than it has?
The operating system ends the process, and it restarts. If that repeats, either the limit is too tight or your bot keeps more in memory than it needs.
Does a music bot need more?
Yes. Decoding and buffering audio costs memory, and ffmpeg usually runs as a process of its own. Plan 512 MB to 1 GB.