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

I think there is kind of memory leaks or something like that #146

Open
dukobpa3 opened this issue Jan 14, 2024 · 5 comments
Open

I think there is kind of memory leaks or something like that #146

dukobpa3 opened this issue Jan 14, 2024 · 5 comments
Labels
question Further information is requested

Comments

@dukobpa3
Copy link
Contributor

TrguiNG been running couple days no closing and finally became laggy and glitchy until I've relaunched it

@qu1ck
Copy link
Member

qu1ck commented Jan 14, 2024

I am running it for weeks at a time on windows, no issues. Are you on mac? Do you use hide window feature or close?

Next time this happens check memory usage when window is opened and also when window is closed (not hidden). And if it fixes itself after window is closed and reopened. That will narrow it down to where the leak is, in frontend or backend, if there is one.

@dukobpa3
Copy link
Contributor Author

Im not sure what is hide and what is close in this case
I'm on mac, yes. I'm not using status bar(tray) icon. Window is always opened but mostly minimized in taskbar.

@qu1ck
Copy link
Member

qu1ck commented Jan 15, 2024

I was referring to this setting

image

But since you are not using tray icon you and just minimize the window your frontend is still running.

So to narrow the issue down enable the tray icon for now and next time you experience sluggishness check memory usage and try to close the frontend and reopen it (click tray icon -> hide and then open). If it's still sluggish then the issue is in the backend but it's unlikely.

@qu1ck qu1ck added the question Further information is requested label Jan 17, 2024
@dukobpa3
Copy link
Contributor Author

Ok
Thought about it

Hiding and closing are different only by "icon from where to start next time"
So hiding is actually the same as closing from my point of view.

And if opened/minimized app eats memory or cpu in progression while running – there is an issue.

@qu1ck
Copy link
Member

qu1ck commented Jan 17, 2024

You are not reading what I wrote, I'm not saying there is no issue, I'm giving you steps to help me narrow down where the issue might be. Because I don't use mac I can not investigate myself. This does not happen for me on Win or Linux or Mac VM (although I can't run my VM for weeks).

First you need to confirm that there is actually a memory leak, check memory usage in activity monitor app.
Second, if there is a memory leak, narrow it down to if it happens in backend or frontend. Activity monitor should also help there since frontend process looks like "tauri://localhost" there.
Third, if there is a memory leak and it's in frontend then you can verify if it's the app code leaking or if it's webkit's inefficiency. You can check in inspector tools by right clicking somewhere in details panel, choosing "Inspect element", then switching to "Timelines" tab, recording few seconds of data, navigating to "Memory" (you may have to enable memory profiling before recording to have that section visible).
This is what healthy state should look like, give or take.

image

If your JavaScript section takes gigabytes then it would be leak in app code. If your page or other section takes gigabytes then it would be leak in webkit.

Hiding and closing are different only by "icon from where to start next time"
So hiding is actually the same as closing from my point of view.

From user facing point of view they are the same. But as the hint explains, closing saves RAM significantly (think 300-500MB vs 20-30MB). And if it happens that there is a memory leak and it's not in app code but in webkit, then there would be nothing I could do and using that close option would be the only workaround.

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

No branches or pull requests

2 participants