How does HudMessage`s memory clearing work?

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
User avatar
Bilbö Bägginson
Posts: 24
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

How does HudMessage`s memory clearing work?

Post by Bilbö Bägginson »

I made a function to play a video clip. Made it via acs-cicle not via animdefs becase I want it to play from the begining when level starts.
And just about on the 600th frame, RAM starts to quickly feel up from ~400 mb to 1500—2000 mb by the end of the clip. So it causes severe stuttering on the screen.

Code: Select all

 for(int i=1; i<946; i++)
 {
  if(i<10) string = "ASHW00";
  else if(i<100) string = "ASHW0";
  else if(i<1000) string = "ASHW";
  Frame = strParam(s:string, d:i);
  setfont(Frame);
  hudmessage(s:"a"; HUDMSG_PLAIN, i, cr_white, 475.0, 360.0, 0.06);
  delay(2);
 }
Maybe there is a way to clean memory by hand in the script?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48535
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How does HudMessage`s memory clearing work?

Post by Graf Zahl »

How large are the textures? It doesn't really matter if you use this or ANIMDEFS - the texture management currently has no eviction logic for textures taking up too much memory so all your frames add up.
User avatar
Bilbö Bägginson
Posts: 24
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

Re: How does HudMessage`s memory clearing work?

Post by Bilbö Bägginson »

Graf Zahl wrote:How large are the textures?
From 14 to 60 Kb,
30 Mb in total
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48535
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How does HudMessage`s memory clearing work?

Post by Graf Zahl »

I mean size in pixels.
User avatar
Bilbö Bägginson
Posts: 24
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

Re: How does HudMessage`s memory clearing work?

Post by Bilbö Bägginson »

Graf Zahl wrote:I mean size in pixels.
Ah 1280x720
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48535
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How does HudMessage`s memory clearing work?

Post by Graf Zahl »

Those textures combined will be an entire GB of VRAM. The texture manager wasn't really made for this kind of animation. Depending on your memory situation part of that GB will end up in the main RAM.

I think the only way to handle this case is to add a means for the mod to explicitly evict a texture it knows it doesn't need anymore- Of course you have to be careful then to do the eviction only if the texture is definitely not being rendered anymore - otherwise it'd just be recreated again and not be deleted a second time.
User avatar
Bilbö Bägginson
Posts: 24
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

Re: How does HudMessage`s memory clearing work?

Post by Bilbö Bägginson »

Completely delete textures from pk3 so they will never can be played again? Sounds not good. I`ll try to resize them maybe.
But Im interested, if there is any way in gzdoom now to delete lumps from archive right while the engine is running?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48535
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How does HudMessage`s memory clearing work?

Post by Graf Zahl »

No, delete from memory after you displayed them. This will require an engine change.
User avatar
Bilbö Bägginson
Posts: 24
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

Re: How does HudMessage`s memory clearing work?

Post by Bilbö Bägginson »

Graf Zahl wrote:No, delete from memory after you displayed them.
That would be great feature.

I`ve resized them to 640x360 and there is no leak now. But I do not know if it will not be on other computers with less Vram.

Return to “Technical Issues”