Crash Report Help Needed: "bad allocation" Error
-
Hello everyone,
I've encountered a perma freeze (Not crashing though) in FAF during a game, and I’m not sure what might be causing it. Below is the relevant portion of the log file, where it reports a crash in DoSimBeat() with the error "bad allocation." Unfortunately, I'm not familiar enough to pinpoint the issue.
Here’s a snippet from the log:
info: Sim crashed hard in DoSimBeat(): bad allocation ... debug: Session time: 00:54:38 Game time: 00:48:54 Heap: 808.8M / 729.2M ...It looks like memory usage was a factor, but I’m uncertain if it’s tied to my mods or a specific in-game event.
Mods I'm Using:
UI Mods:
- Advanced Selection Info
- Advanced Target Priorities
- BrewLAN: Gameplay Mods
- Build Range Preview
- Phillip Crofts Soundtrack
- Penguin's Icon Mod
- Redux ACU Icons
- SupCom Vanilla Music FAF
- ShareMouse
- Supreme Economy Next
- Supreme Score Board
SIM Mods:
- BlackOps FAF: ACUs
- BlackOps FAF: EXUnits
- BlackOps FAF: Unleashed
- BrewLAN
- BrewLAN: Additional Unit Mods
- Buildable Lower Tiers Experimentals in Factories for TotalMayhem
- Damage Numbers
- EXPERIMENTAL UNIT HEALTH X1.5
- Kennel Engineering Stations for All
- M28AI
- No Build Restrictions in Campaign
- No Friendly Fire
- PJ Infrastructure Pack
- Reclaim Turret Aggressive
- Smart Tactical Missiles
- T4 Energy Generators
- Total Mayhem
If anyone has experience debugging this kind of crash or sees a potential mod conflict that might be triggering the issue, I’d really appreciate your insights. Could it be memory-related due to heavy mod usage, or is something else at play here?
Let me know if more information is needed.
Thanks in advance for your help!
-
Please attach the log. Maybe it will help to identify the issue.
-
Too big for it to get uploaded, maybe if I could upload it I would have.
Here's a drive link then : https://drive.google.com/file/d/1uA5UOUl5IwPe9nDYq7_ApYnflfQYklt4/view?usp=sharing -
@maudlin27 Is the error related to m28 or/and the gigantic mod list?
Half a million lines about:
warning: Error running lua script: ...er forged alliance\mods\m28ai\lua\ai\m28unitinfo.lua(439): bad argument #1 to `max' (number expected, got nil)and a few
Line 15058: warning: stack traceback: Line 15059: warning: [C]: in function `assert' Line 15060: warning: [C]: in function `pcall' Line 15061: warning: ...r forged alliance\mods\m28ai\lua\ai\m28utilities.lua(247): in function `ErrorHandler' Line 15062: warning: ...er forged alliance\mods\m28ai\lua\ai\m28engineer.lua(1361): in function `GetBlueprintAndLocationToBuild' Line 15063: warning: ...mmander forged alliance\mods\m28ai\lua\ai\m28acu.lua(98): in function `ACUBuildUnit' Line 15064: warning: ...mmander forged alliance\mods\m28ai\lua\ai\m28acu.lua(332): in function `ACUActionBuildMex' Line 15065: warning: ...mmander forged alliance\mods\m28ai\lua\ai\m28acu.lua(2692): in function `ConsiderBuildingMex' Line 15066: warning: ...mmander forged alliance\mods\m28ai\lua\ai\m28acu.lua(5114): in function <...mmander forged alliance\mods\m28ai\lua\ai\m28acu.lua:4154> Line 15067: warning: false M28ERROR Count=2: GameTime 800: Dont have valid water or land zone but are looking to build a resourceAnd a bunch of other warnings which I have no clue about.
-
A decent chance it is, as repeated errors seem to have a significant correlation with crashes. I can look into/try and fix the error messages for the next M28 release, and even if it's not the cause of the crash it should at least make it a bit easier to diagnose the crash cause if it reoccurs.
-
I’ve gone through the game log, and the errors visible there have nothing to do with the crash. Most of the time, it’s just variables that can’t be found.
For example, M28 tries to access a variable where a number is expected, but nothing is returned. Here, the 92,574 error messages could have flooded the log and caused an issue with memory management. (I don’t think so, though — we’ve had worse log spam before, and the log continued to write.)
Brewlan expects a variable named TDFShipGaussCannonProjectile, which doesn’t exist. However, this only causes a standard projectile to be used and shouldn’t crash the game.
My gut feeling tells me that a mod like Buildable Lower Tiers Experimentals in Factories for Total Mayhem, Kennel Engineering Stations for All, or Reclaim Turret Aggressive is responsible. Most likely, it’s a modified unit where the engine expects certain values that aren’t present. But as I said, this is just my gut feeling, so it’s more guessing than knowing.
The only recommendation here is to thoroughly test the mods one by one. Even if you’re 100% certain which mod is causing the issue, debugging it is still difficult (to actually fix the mod).
-
The kind of crash you are describing is more consistent with something doing something illegal, rather than an out of memory error. Out of memory almost always will just dump you out to the desktop.
-
Hi everyone,
After extensive testing, I’ve encountered a consistent freeze during games in FAF, accompanied by the same "bad allocation" error in the logs. Despite disabling various mods one at a time, the freeze persists no matter which mods I remove. This leads me to conclude that the issue might be related to the sheer number of mods I'm running, rather than any single one of them being at fault.
That said, I’d really prefer not to remove my mods altogether. Is there a solution to increase the game's memory capacity to handle this? I’ve already tried using a 4GB patch, but it seems incompatible with FAF.
Does anyone have advice or experience with managing large mod loads and memory limits in FAF? Are there any alternative solutions to enhance memory allocation or optimize performance for heavily modded setups?
Thanks in advance for your help.
-
FAF's already incorporated adjustments to allow more momory, but my understanding (from others who understand things like this better than me) is that the garbage collector used by FA.exe can temporarily require very large amounts of memory, meaning if the game goes over 2GB there is a significant risk of it crashing due to this.
As such, while FAF doesnt immediately crash when 2gb is hit, it may crash soon after.Memory can be reduced by reducing mods, player counts (e.g. in the case of AI games), unit counts, unit variety (e.g. playing with everyone as the same faction uses less memory than having all factions in play), smaller maps.
-
Another point to check is you're using the latest versions of the mods in case there was an error that's been fixed (e.g. checking the log, the version of M28 used was v142- so a decent chance the errors relating to M28 were resolved in a more recent update, although I'll add a couple of redundancies in the upcoming release for the specific error message).
-
DXVK (DirectX Vulkan Wrapper) can indeed alleviate memory overflow issues in certain games by optimizing memory management and resource loading strategies, particularly when running 32-bit applications on the Windows platform, where the effect is particularly noticeable.
- Download and unpack the d3d9.dll file from the x32 directory in the DXVK archive.
- Simply place d3d9.dll in the same directory as ForgedAlliance.exe.
doitsujin/dxvk#Public#Version 2.7.1
https://github.com/doitsujin/dxvk/releases -
When loading more than ten mods,the 40km map can be completed smoothly with DXVK on my pc, but the 80km map usually crash.





-
-
I believe the core issue is the extremely large map in combination with the ton of custom units, other mods and AI. SC can only manage ≈ 3.5 GB memory. When it tries to allocate more, it will crash. This becomes more likely the longer the game goes on.
DXVK may help with GPU performance issue, but will not change the memory limit.
You could try the LOUD project, they focus on making it playable on extremely large maps with many units. There are still limitations, but worth a try.
-
@magge Thanks.
1.Based on my personal experience with DXVK, I still insist that DXVK can indeed alleviate memory overflow issues. Welcome everyone to try it out.
INFO: Sim crashed hard in DoSimBeat(): bad allocation
DEBUG: Session time: 00:35:31 Game time: 00:17:54 Heap: -1.360G / 1.519G2.LOUD project is very good. It seems to have its own compatible mod ecosystem. I have tried LOUD's latest v7.32, and I still feel more comfortable playing in FAF.
-
I play 40 x 40 maps often and we do get some strange things happen after 5 hours real time. Worst case is when a human player's machine has an exception error, his game locks up, times out. He ends up back at windows, game can continue without him although we usually shut it down. Our game logs are big say 6mb to 9mb due to constant warnings.
like ...
warning: Error running lua script: ...mander forged alliance\mods\m28ai\lua\ai\m28navy.lua(7365): access to nonexistent global variable "refCategoryNavalFactory"
stack traceback:
[C]: in functionerror' ...ata\faforever\gamedata\lua.nx2\lua\system\config.lua(58): in function <...ata\faforever\gamedata\lua.nx2\lua\system\config.lua:57> ...mander forged alliance\mods\m28ai\lua\ai\m28navy.lua(7365): in functionManageSACUsInWaterZone'
...mander forged alliance\mods\m28ai\lua\ai\m28navy.lua(2004): in function <...mander forged alliance\mods\m28ai\lua\ai\m28navy.lua:1605>
and ...
warning: Error running OnAdjacentTo script in Entity ueb3104 at 5df06d08: ...ver\gamedata\lua.nx2\lua\sim\units\structureunit.lua(785): table index is nil
stack traceback:
...ver\gamedata\lua.nx2\lua\sim\units\structureunit.lua(785): in function <...ver\gamedata\lua.nx2\lua\sim\units\structureunit.lua:774>Also after about 4 hours the game time gets mixed up.
Real time 5hr 14m .... Game time 3m25sAnyway we are loving the game and it is very rare that we have someone crash.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login