Micro freeze/stutter every 2 minutes in heavy scenes

yasparukko

Active member
Messages
191
Reactions
97
Points
28
What could this be, every 1 ~ 2 minutes I get short freeze in heavy scenes, otherwise I have good fps, 100-120, everything is smooth, but then this freeze happens. I have 12700k. 32gb ram, 3070, but no ssd :unsure:
 
Well, other people have short freezes every frame in heavy scenes :ROFLMAO:

But more seriously, might be the C# garbage collector. Maybe you run almost out of RAM, so the engine runs the garbage collector to free some unused stuff. VaM 1.22 now displays RAM usage, so you could check there if that's happening. Remember, other applications and Windows itself also need RAM.
1678217138999.png



Another thing could be your CPU or GPU overheating and throttling down for a few seconds until it cools a bit. Use software like HWMonitor to have a look at all your systems temperature sensors. When you didn't change factory settings, your system would throttle down when reaching 90°C to protect itself.
 
Another thought....do you want to run at 100-120fps? Assuming you just have a 60Hz monitor like most people, you might want to enable VSync in VaM's options. It can't display more than 60fps anyway, so you actually get smoother animation when running VaM exactly in sync with the monitor. It's another thing if you have a gaming monitor with variable refresh rate (GSync or Free-Sync), but those thing only really make sense for shooters or racing games where reaction is everything. Even with such a monitor I would limit VaM to 60Hz. A lot less fan noise, temperature and energy waste.

(VR is using VSync or a variant of it anyway and there of course you NEED the 90Hz to not get motion sick.)
 
Last edited:
Thank you, never thought it could be memory, it could be it I guess :unsure: I am undervolting my gpu, so its only 55-60 degrees under load, I am going to try to limit the fps, and see what happens. It does feel like VAM is doing something every 2 minutes :confused:
 
But more seriously, might be the C# garbage collector. Maybe you run almost out of RAM, so the engine runs the garbage collector to free some unused stuff. VaM 1.22 now displays RAM usage, so you could check there if that's happening. Remember, other applications and Windows itself also need RAM.

Omg, thank you so much, you were absolutely right, "Heap size" is climbing up to 8.5GB and then drops to 5.8GB every couple of minutes!
Do you think if I get another 32GB of ram would it improve things? :unsure:

vamgpufps.jpg
 
Do you think if I get another 32GB of ram would it improve things?
It might...or not ;)

You could try to make yourself a tiny plugin that runs System.GC.Collect(); every few seconds. That might trade a tiny frame drop every few seconds versus the big one every 2 minutes. Not sure you keep the 100fps, though....stable 60fps should be possible even with that old Unity engine version.

BTW, this might be caused by some badly coded VaM plugin that's just allocating some amounts every frame. 2.7 GB every 2 minutes would amount to some 200kB being allocated every frame. That memory would only be reused once the collector runs, which is apparently every 2 minutes. Always assume, not all plugin creators here know what they are doing ;)
 
It might...or not ;)

You could try to make yourself a tiny plugin that runs System.GC.Collect(); every few seconds. That might trade a tiny frame drop every few seconds versus the big one every 2 minutes. Not sure you keep the 100fps, though....stable 60fps should be possible even with that old Unity engine version.

BTW, this might be caused by some badly coded VaM plugin that's just allocating some amounts every frame. 2.7 GB every 2 minutes would amount to some 200kB being allocated every frame. That memory would only be reused once the collector runs, which is apparently every 2 minutes. Always assume, not all plugin creators here know what they are doing ;)
At least I know now its not my GPU that is faulty, I was considering replacing it (y) A tiny plugin that runs System.GC.Collect(); every few seconds would be great, but I would not know where to begin :cry:
But, is there a way to increase this "heap size"? I still have 14GB ram free
 
Here is a quick&dirty plugin that runs the Garbage Collector once per second. Put it anywhere in a scene or as session plugin.
However, at least for me it makes things a lot worse. You just have a frame drop every second :ROFLMAO:

Unity's old GarbageCollector is simply just that....garbage. There isn't much you can do if....except coding more memory efficiently (which we as VaM users have no influence over). Newer versions of Unity support incremental garbage collection, which should behave somewhat better. Still....if you want performance...use C++ and nothing that uses "managed memory" ?
 

Attachments

  • MacGruber_GarbageCollector.cs
    422 bytes · Views: 0
Thank you so much for this!
Unfortunately, as you said, it did not improve it, there is a fps drop every second or so, maybe it could be useful to manually trigger it on animation changes
But I found the main reason, its VUML script, I have it continuously measure 5 different atom distances, to adjust morphs based on distance. Maybe because I have high fps its workload is higher? :unsure:
If I switch VUML off everything goes back to normal, "heap size" is still increasing, but very slowly. I am going to have to rethink how its run, maybe keep VUML disabled and only enable when needed.

collector.jpg
 
That should require not much resources unless the morphs are expensive ones (like forumla morphs displayed with a red icon in VaM)
Yes, I think you are right, VUML is not the reason. I have narrowed it down to "Subsurface Scattering Skin" plugin now, as soon as its removed I see great improvement :unsure:
 
Last edited:
Well, other people have short freezes every frame in heavy scenes :ROFLMAO:

But more seriously, might be the C# garbage collector. Maybe you run almost out of RAM, so the engine runs the garbage collector to free some unused stuff. VaM 1.22 now displays RAM usage, so you could check there if that's happening. Remember, other applications and Windows itself also need RAM.
View attachment 220390


Another thing could be your CPU or GPU overheating and throttling down for a few seconds until it cools a bit. Use software like HWMonitor to have a look at all your systems temperature sensors. When you didn't change factory settings, your system would throttle down when reaching 90°C to protect itself.

Hi Mac! I just want to say that your replies are always the most usefull!

Seriously! I think that i learned more fundamental things of VaM from a couple of your replies than from the whole forum.

Thank you!
 
Yes, I think you are tight, VUML is not the reason. I have narrowed it down to "Subsurface Scattering Skin" plugin now, as soon as its removed I see great improvement :unsure:

I'm seeing similar thing with Subsurface Scattering plugin. Made a post to creator.
 
I think that there are a lot of not optimized plugins that eat memory. If you keep open the new Performace Tab in the VaM UI, you can see the mermoy heap growing by himself.

If @meshedvr could add a digit after the decimal point of the measurement (made it more precise), i think that users and creators could be able to better debug which plugin have the biggest problem...
 
Would be nice if we could increase this "Heap size" value, I still have plenty of unused ram :unsure:
 
A bit of a necro sorry but this could be helpful for some.

VUML can indeed increase heap by alot depending on what you have in it. For example, even having 10 math floats that are NOT continous ( on execute only ) still keep on increasing the heap. The workaround for this scenario is to have your trigger enable, do your calculations / bool, then disable it. If you are using it to keep track of distance, well... nothing you can do there which brings me to::

Other plugins such as diving lips and hands do the same. They are constant calculations and increase heap.

I`m working on a huge scene where i have 180 floats/bools/strings and the on off solution works wonderfully for VUML.
 
Last edited:
Wow! The next time i'm in the mood for VAM, i'll surely test this! Thanks for sharing!
 
Back
Top Bottom