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

v5.2 High RAM utilisation followed with high CPU use when field formaters and autosave are enabled #7567

Open
1 task
alfureu opened this issue Mar 22, 2021 · 9 comments

Comments

@alfureu
Copy link

alfureu commented Mar 22, 2021

JabRef 5.2--2020-12-24--6a2a512
Windows 10 10.0 amd64
Java 14.0.2

I accidentally left open JabRef with 2 files open over the weekend. When I got back to the computer on Monday I noticed that JabRef uses 8GB out of 32GB RAM, and every 2-3 minutes the CPU bursts into 100% use making even the basic music listening to stutter. For the record, the CPU is an i7-7700HQ, so not that weak. I think this is something the devs should look into, especially the RAM use, as I believe the CPU use is just the consequence of it. I believe it should not happen with a stable version of the app.

Steps to reproduce the behavior:

  1. Turn on JabRef
  2. Leave it open for longer period of time
  3. Observe an ever-increasing RAM use
@alfureu
Copy link
Author

alfureu commented Mar 26, 2021

After 24h of having the JabRef open, with occasional spies to 80% CPU...

image

@Siedlerchr
Copy link
Member

Do you observe the same with the current development version?

@alfureu
Copy link
Author

alfureu commented Mar 27, 2021

testing... give me a couple of days pls

@alfureu
Copy link
Author

alfureu commented Mar 27, 2021

Well, just started the developmental version

JabRef 5.3--2021-03-26--badffe9
Windows 10 10.0 amd64
Java 14.0.2
JavaFX 16+8

and what is immediately noticeable is that it is much more memory hungry, see below:

image

Starting the stable v5.2 stable version it started around ~300MB of RAM, the developmental version starts outright at ~1.2GB. I will keep testing further on...

@alfureu
Copy link
Author

alfureu commented Mar 28, 2021

I can confirm now that after approx. 24h of running JabRef 5.3--2021-03-26-badffe9 the RAM use is very high:

image

As you can see, as a result of this there is a considerable higher CPU use as well. Please note I am not running any tasks on JabRef, I basically just opened the app and kept it open for 24 hours with three .bib files open.

@alfureu
Copy link
Author

alfureu commented Apr 3, 2021

I think I was able to identify the culprit. On one of the .bib files the Field Formatters were set to enabled. As soon as I disabled it, after 24+h the RAM use remained ~700MB. I think it is therefore related to issue #7265

What is happening, as far as I can identify, is that as soon as Field Formatters are turned on a .bak file is created, and somehow the autosave option keeps ramping up the RAM usage over longer period of time, no idea why. Maybe this will be helpful for further investigation if anybody runs into similar issues.

@Siedlerchr
Copy link
Member

Thanks, we are currently in the progress of fixing issues with the save and autosave options, will keep an eye on it

@ThiloteE ThiloteE changed the title High RAM utilisation followed with high CPU use High RAM utilisation followed with high CPU use when field formaters are enabled Jun 16, 2022
@ThiloteE ThiloteE changed the title High RAM utilisation followed with high CPU use when field formaters are enabled v5.2 High RAM utilisation followed with high CPU use when field formaters are enabled Jun 16, 2022
@ThiloteE ThiloteE changed the title v5.2 High RAM utilisation followed with high CPU use when field formaters are enabled v5.2 High RAM utilisation followed with high CPU use when field formaters and autosave are enabled Jun 16, 2022
@ThiloteE
Copy link
Member

meta-issue: #8906

@ThiloteE
Copy link
Member

To do:

  • test with commit 6a71395,
    • there was a bug in "save" that had the potential to change the database --> if so, then field formatters could potentially have been triggered to re-format the new changed database --> then again, autosave could potentially have triggered upon changes of the field formatters --> never-ending loop that leads to high cpu/ram
    • This commit also introduced pauses of 31 seconds between autosaves. Now, field formatters should hopefully have the time to finish, before the autosave kicks in, which theoretically would decrease peak cpu/ram load
      private static final int DELAY_BETWEEN_AUTOSAVE_ATTEMPTS_IN_SECONDS = 31;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Normal priority
Development

No branches or pull requests

3 participants