Freeze on saving
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Freeze on saving
Before I explain the issue, I want to mention that this has been present for a very long time so I cannot determine the exact version. Apparently it happens when there are way too many actors on the level. I happen to be using Ketchup mod which I am sure is the cause and I want to find out why. I'm using GZDoom g2.2pre-2021-gac80ffc btw. I suppose the same applies to ZDoom, too, though Ketchup doesn't run as well on ZDoom because of models and X/Y billboarding so I don't use it there.
EDIT: Hmm, should I post this in the DRDTeam GZDoom bugs forum? I don't think it's GZDoom-specific, but I can't really test on ZDoom due to mod design.
At first the saving takes like a second to complete, but eventually comes a point where saving freezes the game. I can't alt-tab and the whole PC freezes with the exception of the mouse and sound. Ctrl Alt Del does absolutely nothing. Even my keyboard LCD screen goes blank and doesn't budge. I have noticed this only happens when Ketchup spawns way too much blood. It takes a lot of blood to lead to the freeze, but it's not impossible. Slaughtermaps are usually the worst. Maps with ~500 enemies don't have such issue. Go above 800-900 and yer gonna have a problem.
PC Specs:
OS: Windows 10 (x64)
CPU: AMD Phenom II X4 945
RAM: 10GB 16GB DDR3
GPU: Nvidia GeForce GTX 970 Jetstream
I doubt it's because of crappy hardware.
EDIT: Hmm, should I post this in the DRDTeam GZDoom bugs forum? I don't think it's GZDoom-specific, but I can't really test on ZDoom due to mod design.
At first the saving takes like a second to complete, but eventually comes a point where saving freezes the game. I can't alt-tab and the whole PC freezes with the exception of the mouse and sound. Ctrl Alt Del does absolutely nothing. Even my keyboard LCD screen goes blank and doesn't budge. I have noticed this only happens when Ketchup spawns way too much blood. It takes a lot of blood to lead to the freeze, but it's not impossible. Slaughtermaps are usually the worst. Maps with ~500 enemies don't have such issue. Go above 800-900 and yer gonna have a problem.
PC Specs:
OS: Windows 10 (x64)
CPU: AMD Phenom II X4 945
RAM: 10GB 16GB DDR3
GPU: Nvidia GeForce GTX 970 Jetstream
I doubt it's because of crappy hardware.
Last edited by Accensus on Fri Oct 07, 2016 3:18 pm, edited 1 time in total.
Re: Freeze on saving
Do you use 32- or 64-bit build? If it's 64-bit version, can you check RAM usage in Task Manager? I.e. play in window and leave Task Manager open to see the stats.
I'm curious because the problem you described is very similar to infinite disk swapping: when some app actively uses more memory than available RAM.
It could be totally different issue but this is worth checking anyway.
I'm curious because the problem you described is very similar to infinite disk swapping: when some app actively uses more memory than available RAM.
It could be totally different issue but this is worth checking anyway.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Freeze on saving
I have experienced similar issues when running out of available RAM as well. Which is strange for Doom mods to require this much memory.
Re: Freeze on saving
64-bit all the way. I'll test and post results soon. Gonna load up Sunlust and play one of the larger levels where it crashed the last time I played it.
Re: Freeze on saving
Alright, so I tested a Sunlust map with 500+ enemies and produced a lot of blood. So much that I was practically unable to aim from lag. The game still took a second to save, but I noticed absolutely no change in either CPU or Memory. The only thing that went up to 50% was my HDD during save, but only sometimes. Most of the time it spiked up to 10% on save and then went back to 0%. CPU got anchored @ 25% and RAM stayed @ 20% (2.1/10.0 GB). I did not push it to the limits, but will do if necessary.
EDIT: Graph was showing 90-100% CPU usage but the Task Manager said 20-25% in the sidebar. It wasn't 50% like I intially said.
EDIT: Graph was showing 90-100% CPU usage but the Task Manager said 20-25% in the sidebar. It wasn't 50% like I intially said.
Re: Freeze on saving
Regarding this, I forgot to mention that the save gets corrupted and stops appearing in the Load Game list. If that happens in the middle of a megawad, it's pretty darn painful.
Re: Freeze on saving
Update on the situation. So I played Zanieon's Reinforced Map Set on Map D06 (huge-ass hangar with lots of monsters) and decided to use actorlist (thanks, Eruanna!) to pinpoint exactly when the freezing starts. Tested with GZDoom g2.3pre-123-gf1bb767. (Should have the new savegame format. I think.)
~14K actors, RAM at 2,5GB/16GB, CPU at 45%.
17566 actors, same as above.
20167 actors, same as above.
Here's the interesting part: freezing occured twice on ~18K actors but after that I could not reproduce it at the exact same spot on the map with even more actors. Also, while program was frozen the resource usage spiked up to 100% on both CPU and RAM and stayed that way until I used divine task manager intervention. The savegame did not get corrupted and I could Ctrl Alt Del out of the game and kill the process without problem.
While saving without freezing the resource usage did not move at all. In fact, nothing gave out any hint that the game's in a near-freeze state. PC specs are the same as in main post, only with 16GB of RAM now.
~14K actors, RAM at 2,5GB/16GB, CPU at 45%.
17566 actors, same as above.
20167 actors, same as above.
Here's the interesting part: freezing occured twice on ~18K actors but after that I could not reproduce it at the exact same spot on the map with even more actors. Also, while program was frozen the resource usage spiked up to 100% on both CPU and RAM and stayed that way until I used divine task manager intervention. The savegame did not get corrupted and I could Ctrl Alt Del out of the game and kill the process without problem.
While saving without freezing the resource usage did not move at all. In fact, nothing gave out any hint that the game's in a near-freeze state. PC specs are the same as in main post, only with 16GB of RAM now.
- DoomKrakken
- Posts: 3489
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
- Contact:
Re: Freeze on saving
This happens a lot with me as well, when I'm playing Guncaster with Stronghold: On The Edge Of Chaos. I've had to manually shut down my computer in order for it to stop, since sometimes, the computer can't even run Task Manager at that point.
Sometimes it happens even without saving, when playing said mods together. And I might not even be using the other lag-inducing effects...
Sometimes it happens even without saving, when playing said mods together. And I might not even be using the other lag-inducing effects...
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Freeze on saving
That sounds like a problem with the garbage collector, not the save system.
- DoomKrakken
- Posts: 3489
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
- Contact:
Re: Freeze on saving
Sounds like it...
(Is there a place where I can go report Garbage Collector bugs?)
(Is there a place where I can go report Garbage Collector bugs?)
Re: Freeze on saving
Here is fine, this is the ZDoom bug forum.
- DoomKrakken
- Posts: 3489
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
- Contact:
Re: Freeze on saving
Ok... but more specifically, I meant an active thread... because this thread is about save freezes. I don't want to create a new thread if there's one already bringing attention to the problem...
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Freeze on saving
I believe the save freezes are the same thing. This is not the savegame system but the garbage collector that's screwing up. The save system does not have any potentially infinite loops that might occur, when I rewrote it I made damn sure that there's nothing recursive or potentially endlessly looping at all in there.
Re: Freeze on saving
Except I'm pretty sure it doesn't get triggered during saving. It does a full collection at map change, and the only other time it should trigger (excepting via console command) is as part of the world think when memory usage warrants it, and then it's only incremental collection until it finishes.Graf Zahl wrote:That sounds like a problem with the garbage collector, not the save system.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Freeze on saving
I have no idea. The savegame code seems an unlikely cause here, but there's one important difference between ZDoom and GZDoom here that may be important: GZDoom, in order to reduce save file size, destroys all attached lights before saving out the data and restores them right afterward. So it is doing a high number of allocations that could end in a memory-constrained situation and trigger the GC. But I have no clue how it could lock up. It never happened to me, even under the most stressed situations.