• Happy Holidays Guest!

    We want to announce that we will be working at reduced staffing for the holidays. Specifically Monday the 23rd until Jan 2nd.

    This will affect approval queue times and responses to support tickets. Please adjust your plans accordingly and enjoy yourselves this holiday season!

  • Hi Guest!

    Please be aware that we have released a critical security patch for VaM. We strongly recommend updating to version 1.22.0.7 using the VaM_Updater found in your installation folder.

    Details about the security patch can be found here.

Solved Too many heap sections

Vesolye

New member
Messages
10
Reactions
7
Points
3
I have 64gb ram now, so there should be no problems theorically, but it keeps crashing my game.

Yesterday, it requires 10-13 scenes to crash, but today only one scene with timeline is enough to crash with this message.

Maybe it was caused by my enormous amount of addons? I cannot guess...
 
Solution
So I’ve been struggling with this for a while and I think I found a solution.

Short version: remove VARs with too many morphs, namely those by Universens and noheadnoleg.

Longer version:

I wasn’t able to open scenes with more than 2 people in it, without getting the dreaded "Too Many Heap Sections". I’ve read that it was not about not having enough physical RAM, which I can confirm from my experience. I do have LOTS of VARs and I was pretty sure that was the reason, but I was not sure why.

I found a very interesting thread about VAM performance where MeshedVR explained that VAM performance wasn’t directly related to the number of VARs, but it is related to the number of morphs, including the ones in VARs and all duplicates. He...
No, it should stay open of course. If it closes there was probably some error. Python probably needs to be version >= 3
I have 3.13 I believe. it runs normally and lists vars with lots of morphs and shows errors like "x is not a zip file" pretty quickly till I reach about X named vars and then it just closes.
 
Upvote 0
I have 3.13 I believe. it runs normally and lists vars with lots of morphs and shows errors like "x is not a zip file" pretty quickly till I reach about X named vars and then it just closes.
There shouldn't be any files with a .var extension anywhere in your AddonPackages that aren't zip files. Try removing the ones it complains about
 
Upvote 0
There shouldn't be any files with a .var extension anywhere in your AddonPackages that aren't zip files. Try removing the ones it complains about
wait. I thought .var files are supposed to go into the addonpackages folder? the "zip error" looks like the one in my screenshot. it will run till the end and show the list of files with lots of morphs, but instead of remaining open, it just closes. I originally thought it was supposed to make a txt file with the results.
 

Attachments

  • Screenshot_1.png
    Screenshot_1.png
    107.9 KB · Views: 0
Upvote 0
wait. I thought .var files are supposed to go into the addonpackages folder? the "zip error" looks like the one in my screenshot. it will run till the end and show the list of files with lots of morphs, but instead of remaining open, it just closes. I originally thought it was supposed to make a txt file with the results.
Yes, .var files do go to AddonPackages. But .var files are zip archives, just with a different extension. The point is there shouldn't be any .var files that aren't actually zip archives. The script identifies these and skips them.

It looks like the .vars that it complains about are behind symlinks and that's why it fails to read them as zips...

Try running the script in PowerShell instead, see if stays open.
 
Upvote 0
I'm not exactly sure how to do that. I just followed the instruction of renaming the .txt file provided into a .py one and ran it inside my addonfolder. is that the one where I have to open a powershell window with shift+rightclick?
Ah, if you just open the file, the window will close automatically upon completion. You need to run it by first opening a command prompt or a powershell, then navigating to the AddonPackages folder where your script .py file is located, and then run it from there. The commands that you need to type into the command line interface are in the post where I attached the script. You can find PowerShell and Command Prompt in your start menu.
 
Upvote 0
Ah, if you just open the file, the window will close automatically upon completion. You need to run it by first opening a command prompt or a powershell, then navigating to the AddonPackages folder where your script .py file is located, and then run it from there. The commands that you need to type into the command line interface are in the post where I attached the script. You can find PowerShell and Command Prompt in your start menu.
ok so I managed to get it to finish this time, but I think the results aren't correct since I cannot view the top most results.
 

Attachments

  • Screenshot_3.png
    Screenshot_3.png
    55.6 KB · Views: 0
  • Screenshot_4.png
    Screenshot_4.png
    44.1 KB · Views: 0
Upvote 0
ok so I managed to get it to finish this time, but I think the results aren't correct since I cannot view the top most results.
You can either redirect the output to a text file:

Code:
python .\morphbloatscanner-1.1.0.py --min 1 --path . | Set-Content -Path morphbloatscanner_result.txt

Or increase the amount of history you can scroll in the properties (right click on the powershell window title bar):

1728576014335.png
 
Upvote 0
You can either redirect the output to a text file:

Code:
python .\morphbloatscanner-1.1.0.py --min 1 --path . | Set-Content -Path morphbloatscanner_result.txt

Or increase the amount of history you can scroll in the properties (right click on the powershell window title bar):

View attachment 418052
ok, figured it all out now. thanks a lot!! man, I don't even know where to start to delete stuff.
 

Attachments

  • Screenshot_5.png
    Screenshot_5.png
    145.9 KB · Views: 0
Upvote 0
Been getting this issue for the shortstack scene since installing the cpu patch... always happens when the scene reaches the restoring atom section. I tried using python, but I'm an idiot and have no idea what I'm doing with python... all that happens is it opens and closes, doesn't tell me anything.
 
Upvote 0
Been getting this issue for the shortstack scene since installing the cpu patch... always happens when the scene reaches the restoring atom section. I tried using python, but I'm an idiot and have no idea what I'm doing with python... all that happens is it opens and closes, doesn't tell me anything.
Do you pass the path to your AddonPackages folder?
 
Upvote 0
From the top of the list, haha.
Hi, I changed your script a little bit, just to find out the total number of all my morphs, this is the number, is it very bad ? I left only files that are less than 500 morphs in one file, however they are not few, in general my VAM works not more than 30-40 minutes, then the error related to morphs :(

1730127782102.png
 
Upvote 0
Hi, I changed your script a little bit, just to find out the total number of all my morphs, this is the number, is it very bad ? I left only files that are less than 500 morphs in one file, however they are not few, in general my VAM works not more than 30-40 minutes, then the error related to morphs :(

View attachment 424233

In an earlier post in this thread it says "meshedvr recommends having less than 10000 morphs overall"
 
Upvote 0
I think I discovered something not previously discussed that may help the folks with heap errors.

Firstly thanks to the heroes like le_hibou for researching and coming up with solutions for the heap problem. Like others before me, I have used Pesadilla's Deduplicator, Bill Prime's Var Manager to reduce the duplicates and clutter. After which I use le_hibou's python tool to ID the remaining worst morph offenders so I can move them away from AddonPackages. And finally sfishere's Var Browser is the only way I can even load VAM because of my huge VAR collection.

Because of the solutions listed above, for me, most scenes (99.9+%) will load without crashing. But sometimes (around 1/4 to 1/3 of the time) I get the heap error if I swap in atoms/Looks, or on subsequent loads of scenes.

Then I discovered something that I don't think I've seen mentioned before: manual heap management.

As we know from the previous posters, Unity's garbage collection is less than ideal. VAM can be configured to do its own GC. But very importantly, MeshedVR gives us the option to trigger garbage collection manually.

You'll find this function in the User Preference section under the Performance 2 tab. The screen shot is below.

Heap Management 2.jpg


While using VAM, if you watch this screen as you load scenes and assets, the amount of utilised memory fluctuates. VAM does mem optimization based on what options you select at the top of this page. But what I notice is that oftentimes I can further lower the used memory if I manually force memory optimization. In some cases, VAM's usage can drop by more than 5GB.

This is huge because my empirical non-rigorous experience is that I will get heap errors when memory usage exceeds 20GB. (I have 64GB system memory)

So these days, I trigger the optimization before I change scenes or import looks. This is a bit of a pain, but this is a heck of lot better than getting heap error and having to restart VAM.

HTH
 
Upvote 0
Quick update. I decided to try doubling my memory to 128GB to see if this buys me more headroom before VAM craps out. I bought more of the exact same memory I had previously. While not a guarantee, I wanted the best odds that the memory timing would not be an issue since all four slots are now occupied.

The quick summary is no love. I continue to see the dreaded heap error.
 
Upvote 0
Back
Top Bottom