Fix: ED_Alloc: no free edicts

May 20, 2025 Daemon666 7 min read 19 преглеждания

ED_Alloc: no free edicts means the engine tried to spawn one more entity than the edict pool can hold, and there was nowhere to put it, so the server aborts. Every player, weapon, grenade, decal, breakable, buyzone, ammo box and env_sprite is an edict. The pool is a fixed array allocated at startup — not something the engine grows on demand — so the fix is always one of two things: give it a bigger pool, or stop something from leaking edicts into it.

1. Understand the limit you are hitting

GoldSrc allocates a fixed edict table at boot. The historical default is 900 edicts, and the classic engine hard-caps the table at 2048. A busy 32-slot server with a plugin-heavy config and an entity-rich map will brush against 900 during a full round without anything being wrong — it just needs a larger table. ReHLDS raises the ceiling above the stock engine's, which is one more reason not to run Valve's binary on a public server.

2. Raise the pool with -num_edicts

The edict count is a launch parameter, not a cvar — you cannot set it in server.cfg. Add it to the command line:

./hlds_run -game cstrike -num_edicts 2048 -strictportbind \
  -ip 0.0.0.0 -port 27015 +map de_dust2 +maxplayers 32 +sv_lan 0

On Windows it goes in your start.bat the same way. See the command line reference for where it fits with the rest. Restart fully — a launch parameter is only read at startup, not on map_change.

Confirm it took effect. In the console:

stats

and watch the entity count during a live round. If it climbs steadily toward your new ceiling and never drops after round restart, raising the number only bought you time — you have a leak, and step 4 is the real fix.

3. Rule out the map

Some community maps ship thousands of brush and point entities. If the crash only happens on one specific map, load it on an empty server and check the count immediately:

changelevel awp_india
stats

A map that sits at 1500+ edicts on spawn with nobody connected is the problem by itself — either drop it from your mapcycle.txt or run it only with a lower slot count so the players and their weapons do not push you over the top.

4. Find the plugin that leaks edicts

A leaking plugin creates entities and never removes them. Sprites, laser beams, dropped-weapon boxes, temporary models for HUD effects — anything spawned with create_entity that is not eventually removed. The tell is an entity count that ratchets upward across rounds and never comes back down.

Bisect it the same way you would any crash: halve plugins.ini, restart, and watch the count over a few rounds. The method is spelled out in finding the plugin that crashes your server. Effect and visual plugins (custom grenades, glow, killstreak fireworks) are the usual culprits; a plugin that spawns an entity per shot and forgets to free it will exhaust 2048 edicts in minutes on a full server.

Common errors

  • Crash still happens at exactly the same count after -num_edicts 2048 — the parameter did not take. You edited the wrong start script, or you set it in server.cfg where it does nothing. Confirm with ps aux | grep hlds and read the actual command line the process was launched with.
  • You asked for more than 2048 on stock HLDS — the classic engine ignores anything above its hard cap. If you genuinely need more headroom, that is a reason to move to ReHLDS, which lifts the limit.
  • SZ_GetSpace: overflow or PF_precache_model: Model overflow around the same time — that is a different limit (network buffer / precache tables), not edicts, and it usually points at the same over-eager plugin. See precache overflow on map change.

Verification

After raising the pool and removing any leak, play a full 30-minute map on a populated server and watch stats at round restarts. A healthy server settles back to roughly the same edict count every round — players plus their weapons plus the map's static entities — and never trends upward. If the number is flat across five rounds and the ED_Alloc line is gone from Log/errors-*.log, the problem is solved. If it still creeps, you have another leaking plugin; keep bisecting.

Сътрудници: Daemon666 ✦
Сподели: