Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui memory issue #676

Closed
jhofstee opened this issue Jul 14, 2020 · 5 comments
Closed

gui memory issue #676

jhofstee opened this issue Jul 14, 2020 · 5 comments
Assignees
Milestone

Comments

@jhofstee
Copy link
Contributor

jhofstee commented Jul 14, 2020

As reported here https://community.victronenergy.com/comments/55615/view.html and for earlier versions as well, the gui can run out of memory which make running a process, like reboot or check update fail:

"Resource error (fork failure): Cannot allocate memory"

Not being able to return from the overview to the pages seem to be caused by this:

2020-07-12 12:20:49.219642500 file:///opt/victronenergy/gui/qt-components/qml/Qt/labs/components/native/PageStack.qml:295:7: QML ScriptAction: file:///opt/victronenergy/gui/qt-components/qml/Qt/labs/components/native/PageStack.qml:137: TypeError: Result of expression 'page' [null] is not an object.
2020-07-12 12:20:49.219671500     		if (page.status !== undefined) {

I wouldn't be surprised if that is caused by the same reason, failing to allocate the page and hence pushing a undefined page on to the stack.

Why this setup runs out of memory is unknown at the moment, but it must have to do with user interaction or something otherwise we would have received lots of complaints about the gui getting stuck / ignoring commands.

@jhofstee jhofstee self-assigned this Jul 14, 2020
@jhofstee jhofstee added this to the v2.60 milestone Jul 14, 2020
@jhofstee
Copy link
Contributor Author

There was already a issue for this, just not marked for 2.60, #653

@jhofstee
Copy link
Contributor Author

a ccgx running v2.57 and with a gui not using a lot of memory also encountered this:

2020-07-20 17:38:20.731338500 file:///opt/victronenergy/gui/qt-components/qml/Qt/labs/components/native/PageStack.qml:295:7: QML ScriptAction: file:///opt/victronenergy/gui/qt-components/qml/Qt/labs/components/native/PageStack.qml:137: TypeError: Result of expression 'page' [null] is not an object.
2020-07-20 17:38:20.731369500     		if (page.status !== undefined) {
2020-07-20 17:38:56.476809500 file:///opt/victronenergy/gui/qml/OverviewHub.qml:37: Unable to assign [undefined] to QString iconId
2020-07-20 17:38:56.478249500 file:///opt/victronenergy/gui/qml/OverviewHub.qml:23: Unable to assign [undefined] to QString title

The device can no longer leave the overview and show the pages.

@jhofstee
Copy link
Contributor Author

jhofstee commented Jul 27, 2020

The latest Venus version has some counters / debug options and is already running at the customer its site. There are hundreds of svg's which have a width of 145px and various different heights. Seems like a svg with a property animation on height. In total 30MB or so, so that at least explains where the memory is going (and that is already fixed, since the cache for inline svg's is completely disabled now).

It will now also exit on OOM, so next time it will hopefully occur during allocation of all these images, instead of a random different place (the check update in case).

It remains interesting why the fork fails on low mem, since it doesn't seem to be on memory allocation, nor on mmap failure...

page.status !== undefined is likely unrelated¸ since it occurs on v2.57 as well.

@mpvader
Copy link
Contributor

mpvader commented Jul 29, 2020

Solved - closing

@mpvader mpvader closed this as completed Jul 29, 2020
@jhofstee
Copy link
Contributor Author

The fork failure is caused by https://github.com/victronenergy/linux/blob/ccgx_b4.19.74/mm/util.c#L662

Note: that whole check got replaced in victronenergy/linux@8c7829b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants