Random Crashes - The lead up

Started by WAS, October 30, 2018, 02:59:36 pm

Previous topic - Next topic

WAS

Does anyone else notice when TG suddenly locks up and CTD when you're working casually, does anyone elses TG start slowing down first? Like changing a simple scalar setting causing a visible "Thinking" mouse symbol and hiccuping before applying change?

Note my preview is paused. I'll just get this progressively slower and slower TG for about a minute before a random edit causes a CTD.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Dune

It does help to open a fresh instance of TG now and then (after a few hours working intensely or so). Seems so clear up the memory.

WAS

I wonder if a ram flush with TG active would clear any leaked memory. I'll try a batch loop with the coand every minute and see if I get a slowdown crash. Likely TG will hold onto it lost or not
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

jaf

I've found that if you load a scene with objects (vegetation, hard surface models, etc.) and render it, then without exiting TG, load a different scene with objects, you will find TG did not release all the memory used by the first scene.  If you continue to load and render scenes this way, the memory TG is using keeps increasing.
(24jul19) Ryzen 1800x, 970 EVO 1TB NVME-M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 431.60 (24jul19), Win 10 Pro x64, Terragen Frontier 4.4.18 BMark 0:10:18

WAS

Quote from: jaf on October 31, 2018, 02:47:42 pm
I've found that if you load a scene with objects (vegetation, hard surface models, etc.) and render it, then without exiting TG, load a different scene with objects, you will find TG did not release all the memory used by the first scene.  If you continue to load and render scenes this way, the memory TG is using keeps increasing.


That should be normal behavior though, right? TG reads and loads models into active memory? So two instances (processes) would have their own addressed memory. Me having only 8GB RAM with a total of 21GB usable memory in general, I tend to not open up multiple instances that utilize objects, as often one will be most my memory that is of any useful speed, where physical memory while dedicated, is still at about half the speed of my RAM.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

jaf

I don't think so.  If you load a scene and render and then load a different scene, the first scene is gone.  The next load is into the same instance of TG.  All I'm pointing out is TG does not have a file|close and it doesn't give up all of the memory used by a previous scene, which to me is a bug.  It doesn't occur if you exit TG and then load/render the scene.

Now two instances of TG will use more resources (tg instance 1 plus tg instance 2), but if you're rendering and reloading one or both instances with scenes with objects, one or both instances will use more resources than the first scene(s) render.

I know this sounds confusing -- I'll try to make a workflow/chart that depicts what I'm trying to express.
(24jul19) Ryzen 1800x, 970 EVO 1TB NVME-M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 431.60 (24jul19), Win 10 Pro x64, Terragen Frontier 4.4.18 BMark 0:10:18

WAS

October 31, 2018, 05:27:21 pm #6 Last Edit: October 31, 2018, 05:29:08 pm by WASasquatch
Quote from: jaf on October 31, 2018, 05:10:50 pm
I don't think so.  If you load a scene and render and then load a different scene, the first scene is gone.  The next load is into the same instance of TG.  All I'm pointing out is TG does not have a file|close and it doesn't give up all of the memory used by a previous scene, which to me is a bug.  It doesn't occur if you exit TG and then load/render the scene.

Now two instances of TG will use more resources (tg instance 1 plus tg instance 2), but if you're rendering and reloading one or both instances with scenes with objects, one or both instances will use more resources than the first scene(s) render.

I know this sounds confusing -- I'll try to make a workflow/chart that depicts what I'm trying to express.


Ohh, I thought you meant opening two instances heavily populated and shared memory and duplicate memory for each instance.

What I'm wondering is if these are true memory leaks, or if the ram is being held active erroneously.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

jaf

Doesn't appear to be memory leaks -- it looks like it doesn't release all the memory it used to render the scene, and it's additive if you load a new scene without exiting TG.  Here's a little chart I made using two simple scenes with built in rock populations.  The second scene is identical to the first, but with a larger rock population.  I'm using Sysinternals Process Explorer since it will graph used resources for a process.

1. load and render scene1 (uses 1.9gb after finished rendering)
2. load and render scene1 (uses 2.0gb after finished rendering)
3. load and render scene1 (uses 2.1gb after finished rendering)
4. load and render scene1 (uses 2.2gb after finished rendering)
5. load and render scene2 (uses 2.4gb after finished rendering)
6. load and render scene2 (uses 2.5gb after finished rendering)
Exit Terragen
7. load and render scene2 (uses 2.0gb after finished rendering)
Exit Terragen
8. load and render scene1 (uses 1.9gb after finished rendering)
9. load and render scene1 (uses 2.0gb after finished rendering)

Note that I did not exit Terragen until after step 6.  The scene1 increased TG in size by .1gb upon each load/render as did scene 2 on step 6. Exiting TG and the loading and rendering scene2 gave a .5 decrease in what Terragen was using in memory.  Exiting TG and loading and rendering scene1 put it back at 1.9gb (agreeing with step 1.)  Another load/render put it at 2.0gb.
(24jul19) Ryzen 1800x, 970 EVO 1TB NVME-M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 431.60 (24jul19), Win 10 Pro x64, Terragen Frontier 4.4.18 BMark 0:10:18

WAS

October 31, 2018, 07:04:37 pm #8 Last Edit: October 31, 2018, 07:07:52 pm by WASasquatch
That's pretty much what a memory leak is, and looks like such. When a program isn't handling memory allocation appropriately and fails to release them. I tried several methods of flushing memory and TG will not release the erroneously allocated memory, and nothing in TG can fix that (aside from ending the process), so it's been "leaked".
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

jaf

Yes.  I wasn't sure if you were reloading without exiting TG, and using two instances, it might be more severe.  I need to check that, but I highly suspect that's true.
(24jul19) Ryzen 1800x, 970 EVO 1TB NVME-M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 431.60 (24jul19), Win 10 Pro x64, Terragen Frontier 4.4.18 BMark 0:10:18