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

[bug]: [UI]: Memory Leak #1348

Closed
1 task done
chrisguida opened this issue Mar 21, 2022 · 8 comments
Closed
1 task done

[bug]: [UI]: Memory Leak #1348

chrisguida opened this issue Mar 21, 2022 · 8 comments
Assignees
Labels
Bug Something isn't working UI Issues pertaining to any of the embassy-served web applications

Comments

@chrisguida
Copy link
Contributor

Prerequisites

  • I have searched for existing issues that already report this problem, without success.

EmbassyOS Version

0.3.0

Device

Laptop/Desktop

Device OS

MacOS

Device OS Version

11.6.4

Browser

Firefox

Browser Version

98.0.1

Current Behavior

Left the bitcoind service detail tab open for a few days and it was using 13GB of ram.

Expected Behavior

The UI should probably never need more than a few MB of RAM.

Steps to Reproduce

  1. Open bitcoind service details page
  2. Leave open for a few days

Anything else?

No response

@chrisguida chrisguida added Bug Something isn't working Needs Triage Needs to be assigned a priority labels Mar 21, 2022
@MattDHill MattDHill added this to the 0.3.0.1 milestone Mar 21, 2022
@MattDHill MattDHill removed the Needs Triage Needs to be assigned a priority label Mar 21, 2022
@MattDHill MattDHill assigned MattDHill and unassigned dr-bonez Mar 21, 2022
@MattDHill MattDHill added UI Issues pertaining to any of the embassy-served web applications P1 - Blocks Release This issue must be addressed before the coming release is shipped labels Mar 21, 2022
@MattDHill MattDHill assigned Blu-J and unassigned MattDHill Mar 21, 2022
@Blu-J
Copy link
Contributor

Blu-J commented Mar 22, 2022

So, for firefox, no memory leak detected

For Brave + mocks / my embassy, no leaks detected. The only allocation is in collectIfNeeded and is cleaned up like it should. See Below
image

The code found, which is my vaultwarden plugin

    function collectIfNeeded() {
        if (pageHref !== window.location.href) {
            pageHref = window.location.href;
            if (observer) {
                observer.disconnect();
                observer = null;
            }
            collect();
            if (observeDomTimeout != null) {
                window.clearTimeout(observeDomTimeout);
            }
            observeDomTimeout = window.setTimeout(observeDom, 1000);
        }
        if (collectIfNeededTimeout != null) {
            window.clearTimeout(collectIfNeededTimeout);
        }
        collectIfNeededTimeout = window.setTimeout(collectIfNeeded, 1000);
    }

Has nothing that looks like a leak. and the collect is just calling a chrome extension.

@Blu-J
Copy link
Contributor

Blu-J commented Mar 22, 2022

And the states for the check indicators are

Blue Pi
image

Black Pi
image

Mocks
image

@Blu-J
Copy link
Contributor

Blu-J commented Mar 22, 2022

Next time, could we capture the
memory snapshot

and the dom since there was a #document increasing for @MattDHill box

@chrisguida
Copy link
Contributor Author

What specifically should I capture next time I see this?

@MattDHill MattDHill removed the P1 - Blocks Release This issue must be addressed before the coming release is shipped label Mar 23, 2022
@MattDHill MattDHill removed this from the 0.3.0.1 milestone Mar 23, 2022
@Blu-J
Copy link
Contributor

Blu-J commented Mar 23, 2022

savingSnapshot.mp4
copyingHtml.mp4

@chrisguida
Copy link
Contributor Author

Awesome, thanks so much @Blu-J ! Will definitely do this next time I see this leak.

Btw what software are you using to make these videos?

@Blu-J
Copy link
Contributor

Blu-J commented Jun 8, 2022

I should have a fix via #1505
Should see this fixed in the beta + master today

@Blu-J
Copy link
Contributor

Blu-J commented Jun 23, 2022

Haven't seen this in a while, and then if we do please capture everything that is needed. Hars, snapshots, ...

@Blu-J Blu-J closed this as completed Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working UI Issues pertaining to any of the embassy-served web applications
Projects
None yet
Development

No branches or pull requests

4 participants