"Ran out of virtual memory." While cooking map

I’ve recently expanded my map and it now fails to cook. I’m getting the following error in my logs:



[0194.90] Critical: appError called: Ran out of virtual memory. To prevent this condition, you must free up more space on your primary hard disk.
[0194.90] Critical: Windows GetLastError: The system cannot find the file specified. (2)
[0197.66] Log: === Critical error: ===
Ran out of virtual memory. To prevent this condition, you must free up more space on your primary hard disk.


I have over 150gig free on my primary hdd, and i have 16 gig of ddr4 ram.

Has anyone experienced this or know how to fix it? Also, what are the implications of not cooking a map?

Cheers

With the map opened in the editor, how much ram are you using in the task manager?

Windows might be limiting how much space is available for a swap file. You can fix that in Control Panel, System, Advanced system settings, Advanced, Advanced. On that tab there’s an option to change available virtual memory.

If you need to do a lighting build bigger than what your computer can handle, you can try building it on an Amazon Web Services EC2 instance. You can upload your whole UDK folder to an AWS S3 folder (or you could upload it to Dropbox or similar if you have the room available). Start an EC2 instance with all the memory you could possibly want. Connect to it via RDP, retrieve your UDK folder, and start cooking.

If you don’t cook the map, you can still play it. You’ll just get a message telling you that maps need to be cooked. You can turn that off with the console command DisableAllOnScreenMessages or something like that. And of course, the map won’t have cooked lighting. Cooked lighting performs better and looks much better.

In some cases you just won’t be able to cook the lighting. If you have hundreds of thousands of foliage instances spread across a 10 km x 10 km map with lots of toggleable lights, all the memory in the world isn’t going to let you cook that lighting.

Oh wait, I was confused about something for a second. You’re cooking the map for distribution, right? Not building the lighting?

Even if the map doesn’t get cooked, you can still copy the uncooked map file into the directory structure that you’re going to distribute. You might not be able to include it with the installer that UDK makes, so you’ll have to make your own installer. If you’re going to distribute it on Steam, then you won’t be using the UDK installer anyway.

@O_and_N With the map open in the editor, I’m using a total of 6.7Gb (only ~1.2Gb of this is being used by the map). So only around 40%of my total available memory with over 9Gb free.

I don’t use any baked lighting and the map file is 377mb.

@Nathaniel3W I tried increasing my windows virtual memory to 16gb but it didn’t seem to have any affect:

https://content.screencast.com/users/coldscooter/folders/Jing/media/7a33089f-50d2-4541-9748-a0bd9bf41236/2018-05-20_1129.png

When doing a full cook in Unreal Frontend, my system memory (ram) rarely exceeds 50%. It seems whenever it reaches ~8Gb of usage is when frontend will error out. I wonder if frontend has some memory limit cap…?

I did manage to finally package a cooked version by doing the following:

  • While in Unreal Frontend, I removed all maps from “Maps to Cook”. Then did a “Clean and Full Recook”.
  • Then I added my menu map and did a “Cook Packages”.
  • Then added my main map and did another “Cook Packages”.

Note: If I try to cook my main map before my menu map, it always fails with the “ran out of virtual memory” error. However the ordered steps above do allow everything to be cooked and packaged.

However now I’m concerned I have a compounding problem that will continue to get worse as my game grows (as I was always previously able to do a “Clean and Full Recook”).

As @ mentions above, I’ve also tried dropping the uncooked map into the installed UDKGame\CookedPC\Maps directory and results in the map loading with no textures or any assets (just the landscape).

Would love to get to the bottom of this problem.

Btw, here’s the release I was able to get out if you’re interested: Steam :: Subsistence :: Update Details (18th May 2018) Big Map Expansion! Configurable hunter attacks, difficulty tweaks and more!

I’m probably going to have the same problem.

Have you tried splitting the landscape into stream levels, each with its own foliage tool, and having them all permanently loaded on the map?

Maybe 4 or 9 small landscapes won’t have the problem.

Ever since I distributed my first Built With UDK game, I’ve had issues with assets not appearing in the cooked levels. For me it was almost always particle emitters and sounds. I never had an issue with missing textures (unless the missing particles were ultimately the result of missing textures). I was able to fix the problem by copying my own uncooked upk content files and maps into the final distribution (into the Content folder, not the CookedPC folder). I’ve never had a problem cooking the maps. And I’ve never tried making a multiplayer game. I’d be very interested in hearing how you end up fixing this.

Edit to include some information that might be useful: IIRC, you don’t actually have to cook anything unless you’re distributing on consoles. Just don’t run the executable with seekfreeloading.

Thanks for the tips @Nathaniel3W. Regarding running the executable without seekfreeloading, I’m not quite sure how to do this…

Do you mean on the


UDK.exe CookPackages -platform=PC ColdMap1.udk

command? Because I don’t see it running that in the frontend console.

Or is that just a command that gets baked in a launch option when the game runs?

The documentation (https://api.unrealengine.com/udk/Thr…ntCooking.html) states “UE3 on PC can load cooked, uncooked, or even a mix of both.”.

If I remove maps from “Maps to Cook” in Frontend, then the packaged game doesn’t have them at all. So I’m really not sure how to package a game without cooking the maps.

Yeah, -seekfreeloading is a command line option for starting the game. It tells the game executable to use cooked packages. I’m not sure whether Frontend creates an executable with -seekfreeloading hardcoded. I don’t think it would. Does it make a shortcut that runs “YourGame.exe -seekfreeloading”? In your Steam Pipeline options somewhere you can set the command to run (with command line options) when the player starts your game.

If you distribute and play your game with uncooked packages, be sure to place them in the Content or Content/Maps folder, and not in the CookedPC folder or other cooked folders.

Cooked packages are smaller and they load faster, so cook them if you can. But they shouldn’t be strictly necessary if you have a map that just refuses to cook. In my experience, I was able to run “MyGame.exe -seekfreeloading” and it seemed to have loaded the cooked packages if available. But I always had missing assets for some reason, and when I copied my uncooked packages into the Content folder, I could still run my game with seekfreeloading, and the game found the missing content in the uncooked packages.

Thanks for the response @Nathaniel3W.

I’m still not sure how I would even package the game without cooking the maps. If I remove the maps from “Maps to cook” in Frontend, and then package and install the game. Then manually place the maps in the UDKGame/Content/Maps/ directory, it won’t run. It just asks if i want to recompile and then spits out a bunch of warnings like:


[0001.83] Warning, Can't find files matching C:\Games\Subsistence\Binaries\Win32\..\..\Development\Src\Core\Classes\*.uc

I’d really like to figure out how to package a game without cooking the maps.

@Coldscooter that’s strange. I’ve never had that happen to me. Caveat here, I’m using UE3 and not UDK, so maybe I have more freedom with how I do things…

I get an updated list of my maps by opening a Windows command prompt and typing this command from my Content\Maps folder:



dir /s /b /o > filenames.txt


I compile, build lighting, and cook the maps. I cook the maps with a .bat file:



RPGTacGame.exe CookPackages -platform=PC (...lots of map filenames copy/pasted from filenames.txt...) -final_release -full


Then I take everything that I need and copy it all into a staging directory. That includes Content and Content\Maps. I include all of my UnrealScript files to make everything more mod-friendly, but I think there’s a way to build the game so that it doesn’t need or include the uncompiled UnrealScript. Maybe the uncooked files require you to have the UnrealScript there? If you manually copy files from your development environment instead of letting the installer move them, maybe you get different versions with different functionality? Anyway, from the staging directory, I can run my game’s executable just to test everything out.

Once I have everything I need in the staging directory, I use steamcmd.exe to upload the files from my staging directory to Steam. And once I download my own update from Steam, my game installation works just as well as my development copy.