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

Mass category change causes memory and CPU usage spikes, often leading to tab hang and crash #2650

Open
zdimension opened this issue Apr 7, 2023 · 1 comment

Comments

@zdimension
Copy link

Describe the bug
Changing the category for a lot of operations, from the search page for example, causes the tab to eat up a ton of memory and CPU and the whole page slows down to a halt and often crashes.

To Reproduce
Steps to reproduce the behavior:

  1. Get a list of operations (e.g. search for something so you get more than, say, 20 or 30 operations in the results)
  2. Select one operation, click Select All, so all operations are selected
  3. Change the category

Expected behavior
It changes the category

Screenshots
image

It looks like when a "change category for N operations" job is sent to the server, the server processes it operation by operation, but every time an operation is updated remotely, the list of operations is re-created from scratch on the client, but somehow the old objects aren't GCed fast enough (so the RAM usage increases), and the re-creation of that list eats up the CPU.

Also, if after changing the category, I switch to the budget page (showing categories for the year) the same thing happens; for each operation that is updated (around 1 per second), the list is refreshed and the page is slowed down.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome 111
@Crash--
Copy link
Contributor

Crash-- commented Apr 11, 2023

Hello @zdimension, thanks for the issue.

I just take a look at how we handle the category change:

There is a room of improvements here. The good thing is that there is only one way to handle that change, so if we are able to fix one issue, we'll fix the others 💪

On firefox, I can see the CPU usage, but the GC seems to be working fine. I'll try on a slower device and with a chromium browser.

GitHub
A Banks Aggregator on Cozy. Contribute to cozy/cozy-banks development by creating an account on GitHub.

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