Error encountered during memory allocation at location 2. Game terminated unexpectedly.
Error encountered during memory allocation at location 2. Game terminated unexpectedly.
Hello everyone, I recently purchased a new gaming PC and was eager to try one of my favorite titles: Total War: Rome 2 with the Divide et Impera overhaul mod. Previously, I played this smoothly on an older system without any problems. Now, with my upgraded setup, I often encounter a crash to desktop when the game starts, specifically with the error: "VirtualAlloc (at place 2) returned NULL!". This issue typically appears during intense battles or when exiting them, though it occasionally happens even when idle on the campaign screen. While I understand the mod might be responsible, the modding community hasn’t provided much guidance, making this situation increasingly annoying. I’ve tried several solutions so far: enabling windowed mode, checking the 'unlimited memory' option, reducing graphics settings, clearing files, reinstalling the game, verifying file integrity via Steam, increasing the paging file size, ensuring sufficient SSD space, and monitoring RAM usage. The performance monitor data showed minimal page file activity (around 0.3%), ruling out a RAM leak. I also confirmed there was ample free space on the SSD and monitored resource usage during crashes. Please find my system specifications below: Operating System: Windows 10 Home 64-bit (10.0, Build 19041), Language: English, Manufacturer: Micro-Star International Co., Ltd., Model: MS-7C84, BIOS: 1.20 (UEFI), Processor: AMD Ryzen 9 3900X 12-core (~3.8GHz), RAM: 16384MB @ 3600MHz, Page File: 8395MB used, 11497MB free, DirectX: 12, NVIDIA GeForce RTX 2080 SUPER, SSD: 500GB Samsung 970 Evo Plus NVME M.2, Power Supply: Corsair RM650 Gold Modular. A few notes: My brother has an identical build and doesn’t experience this issue, using the same game and mods in the same sequence. The only software involved during crashes is usually Steam, Rome2.exe, and Edge. I’ve attached the exact error message for your reference. I’m hoping someone can help me identify the underlying configuration so I can resolve this problem or find a permanent fix. Thank you all in advance for your assistance!
Install memtest86 on a USB drive and boot from it. Observe how the RAM is being used; the game attempts to reserve memory but fails due to restrictions. Adjust settings to cap memory usage at a lower level, perhaps reducing it to under the limit. Consider restricting the game to 6-8 cores, as it may struggle with excessive threads or cores.
Hi Marius, your memtest showed no errors and RAM seems healthy. I disabled the unlimited video memory, and since the game runs on a 32-bit engine, it usually uses only a few cores. The VirtualAlloc issue persists though. Have you tried any other tweaks or settings?
I encountered the same issue: "VirtualAlloc (at place 2) returned NULL!" It was challenging, requiring several hours to understand the solution. I used Google Translate for clarification. I signed up to assist others facing this error. Here’s what I learned: - VirtualAlloc relates to virtual memory; prior to Windows 10 it was known as a paging file. - At place 2, the problem likely involves a second hard drive. If the issue was on drive C, you should open "PC settings," go to "System," click "About" on the right, then "Advanced system settings." In "System Properties," select "Advanced options," click "Configuration," choose "Advanced options," and under Virtual Memory, click "Change." This lets Windows assign virtual memory automatically or manually. In my case, I set a fixed amount, but letting Windows handle it was the easiest solution. Hope this helps those with similar problems. Greetings from Spain, a country in difficult times, but still home to brave individuals. DEUS VULT!
Sure, I can help with that. The guidance you're referring to likely comes from a specific document or tutorial, but since it's not directly accessible, I recommend checking the original source for details on platform differences between Windows 10 and Windows 11. Let me know if you need further clarification!