Fix: 'Too many entities' / MAX_EDICTS Reached

July 2, 2025 Daemon666 8 min read 3 görüntülenme

The server crashes or drops everyone with a message about edicts or too many entities, usually mid-round on a busy map. An edict is an entity slot — every player, weapon, grenade, door, decal spawner, and scripted effect consumes one. Classic GoldSrc has a hard ceiling on how many can exist at once, and when a map plus your plugins push past it the engine cannot allocate another and aborts. The fix is either to stop something leaking edicts or to raise the ceiling on an engine that supports it.

1. Read the actual error

The engine reports this a few ways; quote the one you have when you search:

ED_Alloc: no free edicts

means the allocator is completely out of slots. You may also see a precache-time variant:

Host_Error: PF_precache_*: overflow

which is a different limit (too many distinct models/sounds precached) but is frequently confused with the edict ceiling. The edict crash happens during play as entities spawn; the precache crash happens at map load. Knowing which one you have decides the fix.

2. Understand the ceiling

Stock HLDS has a fixed maximum number of edicts compiled into the engine, and it is not large by modern plugin standards. A vanilla map uses a few hundred. Problems start when a plugin spawns entities faster than it removes them — temporary sprites, laser beams, dropped weapons, ammo boxes, zombie ragdolls — and the count creeps up round after round until it hits the wall. On stock HLDS you cannot raise this number; you must reduce consumption. On ReHLDS you have a lever (step 5).

3. Find the plugin that leaks

Watch the entity count climb. Many admin/stats plugins expose it, or you can reason it out: if the crash always happens after N rounds regardless of map, something accumulates entities each round and never frees them. Prime suspects are effect-heavy plugins — grenade trails, weapon skins that spawn view entities, deagle/knife effects, currency drops, zombie mod ragdolls, and anything that calls a create-entity native inside a per-frame or per-kill event without a matching remove. Disable candidates one at a time in plugins.ini, change map, and see whether the slow leak stops.

4. Reduce entity pressure

Independent of any single plugin, cut the baseline:

  • Lower decal churn: a high player count spraying and shooting piles up decal edicts. A stricter decalfrequency helps.
  • Trim effect plugins on high-slot servers — a 32-slot server has far less edict headroom per player than a 12-slot one.
  • Prefer plugins that use temporary/TE messages (which do not consume a persistent edict) over ones that spawn real entities for cosmetic effects.
  • Cap dropped-weapon lifetime so the map cleans up guns instead of leaving dozens on the floor.

5. Raise the limit on ReHLDS

If you run ReHLDS, the maximum edicts is configurable rather than hardcoded. ReHLDS exposes it through its own setting so you can give the engine more slots than the legacy ceiling. Raise it in measured steps — do not jump to an absurd value, because every edict costs memory and a high cap can mask a genuine leak that will eventually bite anyway. Combine a modest raise with fixing the leaking plugin from step 3; the raise buys headroom, the fix removes the cause.

Troubleshooting

  • ED_Alloc: no free edicts after a fixed number of rounds — a plugin leaks entities per round. Bisect plugins to find it.
  • Crash at map load, not during play — that is a precache overflow (PF_precache_*: overflow), not the edict limit. Reduce custom models/sounds the map or plugins precache.
  • Only high-population maps crash — you are near the ceiling and player count tips it over. Reduce effect plugins or, on ReHLDS, raise the cap.
  • Raised the cap on stock HLDS and nothing changed — the setting only exists on ReHLDS. Stock engines cannot go past the built-in number; switch engines or cut usage.
  • Count never drops between rounds — the round-restart cleanup is not removing plugin entities; that is the leak, confirmed.

Verification

After the change, play through more rounds than it previously took to crash, on your busiest map at full population, while watching the entity count. If the count now plateaus round to round instead of climbing without bound, the leak is fixed. If you raised the ReHLDS cap, confirm the new headroom by loading your heaviest map at max slots and triggering the effects that used to crash it — a full round of grenades and kills — and confirm it holds. A stable, non-growing edict count across a full map rotation is the real success signal; a higher cap that still climbs forever just delays the same crash.

Katkıda bulunanlar: Daemon666 ✦
Paylaş: