Out of Memory Error on BJS Page

Trying to debug a running an existing BabylonJS app (Can’t isolate to a playground) I am running into out of memory errors on Edge and Chrome - and lockup on FireFox.

The page and all the resources will load, and the render loop will run once and then the browser shows an out of memory error.
I can’t figure out what is going wrong - any suggestions would help.
This page demonstrates the problem:

This page loads correctly:

The memory profiling tools in Edge/Chrome aren’t helpful.

Any suggestions would be appreciated.
Thanks,
Michael

It seems your problem is in:

static resizeFoyerTitle(loader) {
    const description = loader.getNodeById("Description");
    if (!description)
        return;
    let parentHeight = description.parent.heightInPixels;
    description.onLinesReadyObservable.add(() => {
        let height = description.computeExpectedHeight();
        if (parentHeight == 0) {
            parentHeight = description.parent.heightInPixels;
        }
        if (height > parentHeight) {
            do {
                description.fontSizeInPixels--;
                height = description.computeExpectedHeight();
            } while (height > parentHeight);
        }
        else {
            description.onLinesReadyObservable.clear();
        }
    });
}

parentHeight is 0, so you have an infinite loop:
image

2 Likes

Evgeni,
You truly are a Jedi Master - that was the problem. Thank you so much. Was there a specific technique that you used to identify the problem?
Thanks,
Michael

No, I just hit the “pause” button in the browser debugger and I walked the stack up until finding this piece of code (that was not long as it was always pausing in computeExpectedHeight.