So uh... as many of you know, we've been having crashing issues for years. Mostly from "The Edict Count is Too Damn High". We thought it was just shitty maps from Authors who didn't know what they were doing. The situation was pretty horrible, as you all have experienced. At least this is what we thought. How was this combated? We've had a Weapon cleaner for quite some time. Originally taken from Kigen's implementation in DM or something obscure. I made it our own, adding functionality and just 'Rockin' with it. People complained, it gets changed. Changed and Changed and Changed. I can't even count the revision count that it's currently on, but it's pretty high up there. The Weapon cleaner has caused some damage, making people lose on ZE (Feature), and well, hurting gameplay overall. But it's something we've all had to bear with for a while. I make an update to it, seems ok, or so I thought. So cool it isn't cleaning map items anymore, but everything's crashing even more now! SHIT! We all got pretty fed up with the Situation, @Josh made a thread, received some rather bad feedback. @Haplo made one after saying we're removing @Luffaren's Map (Predator) until the crashing issues are addressed. I've been testing almost daily, getting @Luffaren's hopes up, then both getting crushed when it just dies. It must be a plugin problem. Preposterous! It's a Feature! So I asked around, asking for someone to audit the plugin (again). Pointed out some issues, fixed the issues, it still didn't work. DAMN IT. So one day, I show my latest revision to someone, and they point out something rather obvious. I'm checking Edict indexes instead of using the function GetEntityCount()! What the hell, I'm an idiot! We swap to GetEntityCount, I add the same thing to rdisplay to monitor. Cool! We're doing things properly now, out of the woods. I call Luffaren in, it still crashes. Horrible. @GiGaBiTe's map crashed yesterday and suggested we're leaking entities because his map is awesome and totally superiour (I'm paraphrasing). At the time I thought to myself "Ha, yeah ok. Fix your shit. Thanks!", make a few changes to the Weapon Cleaner, then notice that GetEntityCount only increases and doesn't decrease on Predator. What the hell? Are we leaking?! I do some more investigation, ask around why "The Count" from the Engine Function GetEntityCount is static for the round. Got a bunch of shrugs (Including from the suggester, not that I can blame him at all). So I look at Ed_Alloc (CreateEdict's internal function), and it uses GetEntityCount as a basis for setting Edict indexes. Cool, now we have a big problem. Since Ed_Alloc does this, we can't really do jack shit about this. So at 2AM (Probably the best time) I file a bug on AM's Bug tracker and I post a message to both the HLDS_Linux and CSGO_Servers mailing lists as both engines have this issue . Get two answers in the morning. The definition for GetEntityCount is horribly incorrect. As Asher Baker pointed out, it isn't the number of used Entities, it's the highest used entity index. What the shit? That's the same thing as just checking indexes! But then I realized something... If Ed_Alloc is using this, if we have a high entity count at the end of one round it's going to hurt us going into the next rounds. This isn't good. So I wrote a SourceMod extension to detour CVEngineServer::CreateEdict(int). Instead of trying to do an action when we hit a certain number of entities (Valve tried this, and failed horrifically). I figured what the hell, I'll just write my own Allocator, NBD. And really? It was one of the easiest things to do. Did a bunch of testing, asked a friend to help out with an issue I was having (I forgot about classes in C++ >.>). Tried some more things, the allocator works on my dev server. Cool! So the allocator works, doesn't crash anymore. However, I did find one issue with it, all edicts are marked as used on mapchange, which is rather odd. But whatever, adding a check for that and allowing the engine to do what it normally does is just fine for now. Time for the test. I copy the binary from my test server to ZE. Make a vote to change to Predator for the third time today. Cross my fingers. I try to bring Luffaren in, but it's way too late (7 45~PM PST). As a matter of fact, no one is around. Good, GMAN FACE TIME. Map changes to Predator, we play a round of normal, entity count seems suspiciously low. I think there's an issue. So I noclip, kind of spooked, and change it to hard when they win on Normal. Cool, that was unnecessary, but eh. The Ent count is still low. I check with my test plugin, shit, it's pretty close to the same counts. We play a few rounds, lost horrifically each time. So I change it to Ultimate, the Server Death Stage. Server Ent count jumps up to 1555 ents, this is the norm for Ultimate. We're Screwed. Round ends, I cringe a bit. The Entity Count stays the same. What the hell? I run sm_wpt, it's still really low. Did I break something? We play, die at the elevator due to people not actively shooting. Round ends, Round 2 on Ultimate. Ent count remains at 1555 according to the engine? Seriously? Wtf is going on now? We should be up to 1800 entities by now. This remained constant for the 1H and 30M we played on Predator with 60~ players. Unless if things continue to get worse with entity usage, we're out of the woods interms of this crash. It's a shame Valve doesn't have their shit together, as this is broken on every engine. On GO, in the disassembly I see HPE is trying for this, but it still seems bugged. Proof Lost: Ed_Alloc crashing. Gained: Stability, Performance improvement. Thanks to everyone for dealing with me testing shit on ZE (Broke the Round Ending for a day), and to @Tony Montana for reporting issues.