• Hi Guest!

    This is a notice regarding recent upgrades to the Hub. Over the last month, we have added several new features to improve your experience.
    You can check out the details in our official announcement!

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...
Why doesn't Meshed just release the V1 code to the community? There's a FAR better chance for us to fix it and make it amazing, than there is for V2 to be a fully fleshed out savior. Every project that becomes open-source inevitably becomes amazing, and bugs get fixed!
Gotta do it for the good of the community.

Why don't you ask meshed? Are you ready to dive yourself into the code and fix those bugs if it goes open source? And I wouldn't even put that under "bugs", that's optimization. And scaling the optimization for situations like this is (to me) kind or proposterous.

Open source is not something you decide one morning out of the blue. VAM has several licenced assets inside its core, meshed couldn't release it. Since the whole lighting system is based on that, you would need to reverse engineer the shader and build something that would work the same way.

And beyond that... not everyone wants to do open source. That's a business decision.

And to be honest, the last part of my message was a polite way of saying: "No one is ever gonna optimize a game for the three dudes that have a 3TB folder of stuff they never use".
 
Upvote 0
Thanks for the reply, I did just throw that idea out there willy-nilly, but I am aware there's a huge amount of money and business property involved. Call it devils advocate, or you know just getting some ideas out in the open.
Anyway - I wouldn't want to take on a complete rewrite, but I definitely would like some visibility into the backend code, to find out where this GC error is stemming from.
As far as I can tell, there's multiple threads with people just randomly guessing at what the solution is. Which I definitely am thankful for, because I've tried every solution that was mentioned.
I'd definitely like to know what is happening under the hood, that's all I'm saying :)
I absolutely love VAM and I use the shit out of it, obviously.
 
Upvote 0
I rolled back the v13 memory fix, and installed v12. It works WAY better and hasn't crashed yet.
 
Upvote 0
Thanks for your feedback, I'm glad it helps, I was really happy when I figured that out.

Here's my script, it's my first time writing Python, so bear with me ;-)

You'll have to rename it from morphbloatscanner.txt to morphbloatscanner.py, because the forum wouldn't let me upload a file with the .py extension.

To execute it, you can just run it from your AddonPackages folder (or any folder with VARs) like this:
python.exe C:\<YOUR_PATH_HERE>\morphbloatscanner.py
Of course, you'll need python.

If you want to customize the max number of morphs by VAR allowed you can use "-m".
If you want to execute the script from anywhere and specify the path to a VAR folder you can use "-p"
Here's an example with both:
python.exe C:\<YOUR_PATH_HERE>\morphbloatscanner.py -m 900 -p C:\<ANOTHER_PATH>\virt-a-mate\AddonPackages

I've only tested with Windows PowerShell

Also, in the script, there's a whitelist of VAR files that are ignored, that was mostly for my use, but that you can customize by editing he script.
With the power of GPT, I updated this script to sort the results by morph count descending, and print out in a tabular format.

As above, the file extension needs to be changed to .py.

Usage (Command line)
Code:
E:
cd VaM\AddonPackages
python .\morphbloatscanner-1.1.0.py --min 1 --path .

Usage (Powershell)
Code:
cd E:\VaM\AddonPackages
python .\morphbloatscanner-1.1.0.py --min 1 --path .

Output example

1718612680297.png
 

Attachments

  • morphbloatscanner-1.1.0.txt
    2.6 KB · Views: 0
  • 1718612798526.png
    1718612798526.png
    32.9 KB · Views: 0
Last edited:
Upvote 0
@everlaster

In the example parameters you need to change -min to either -m or --min.

And one request if easy to include, could you include a morphs sum at the end of the results?

Thank you for sharing, @everlaster and @le_hibou , it's really useful. Perhaps this could be a resource of its own in the Other category?
 
Upvote 0
@everlaster

In the example parameters you need to change -min to either -m or --min.
Fixed
And one request if easy to include, could you include a morphs sum at the end of the results?
Not sure how useful a total would be, since VAM will generally only load morphs from the latest version of a package. You'd just get tons of morphs in the total count that aren't actually loaded in VAM. Easier to check the real number of loaded morphs within VAM at any given time:

1718643231622.png

This number * 12 which is the number of morphs per page, so 253*12 = 3036, for example.

Filter by Show: Custom Package to get a result corresponding to morphs loaded from var packages.

Thank you for sharing, @everlaster and @le_hibou , it's really useful. Perhaps this could be a resource of its own in the Other category?

Maybe, or a Guide for dealing with this heap sections issue, with this script as an attachment. I'll leave that to @le_hibou if they want to do it - feel free to use my edited script.
 
Upvote 0
In my case I wouldn't see the older versions as I have none because I'm a freak in maintaining VaM :LOL: . But I see your point, would be useless to everyone else unless the count would ignore the older versions too.

The option of the morphs manager only shows the preloaded morphs, wouldn't show the others not set to preload. And somewhere was mentioned a correction that even non-preloaded morphs still influence VaM performance, so that's why I was looking to have a full count.
But it's something I can do too i think.
 
Upvote 0
Back
Top Bottom