[Interest] How to prevent large qml forms from hitting javascript stack size?

NIkolai Marchenko enmarantispam at gmail.com
Mon Sep 11 09:28:10 CEST 2023


775k objects, the form is split into smaller pieces mentioned as Components
to load when needed, but qml engine traverses it all completely and
reserves full memory seemingly

On Mon, Sep 11, 2023 at 10:24 AM Ulf Hermann via Interest <
interest at qt-project.org> wrote:

> > In essence: when a form has a large amount of subforms and Components,
> > then, in the internals of qml engine, it is parsed and every piece of it
> > is assigned totalObjectCount which is accumulated recursively for big
> > forms. Then, in qjsengine sources this happens:
> >
> > sharedState->allJavaScriptObjects =
> > scope.alloc(compilationUnit->totalObjectCount());
>
> This form has got to be extremely unwieldy. May I ask what
> totalObjectCount we're talking about?
>
> I recommend splitting the respective component (aka QML file) into
> smaller pieces. QML components are easily nested. You will give yourself
> a much easier time reading the code, too.
>
> best regards,
> Ulf Hermann
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20230911/ea0279a5/attachment.htm>


More information about the Interest mailing list