-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Store Citation Relations in an LRU cache #10958
Comments
I'd love to give this a shot! |
@cardionaut, Sure go ahead, you're assigned. |
@HoussemNasri Is there a large example .bib I could download from anywhere for testing purposes? |
@cardionaut We have a generator script |
@Siedlerchr Thanks! |
If you're looking for examples of BibTeX libraries you can have a look at testbib. The problem could be observable when using a large library run on a low-end computer over a long period of time. So it's more of a small optimization that would only benefit a small number of users. Overall, I don't think you have to reproduce the issue to fix it. You can launch the debugger and observe the number of allocated citations/references in the cache over time, but it's up to you. |
@cardionaut You are right, the generated libraries do not help here. https://github.com/JabRef/jabref/blob/main/src/test/resources/testbib/Chocolate.bib also does not help. - What I did: Query dblp for "Kopp", imported the 100 entires. Then I quiery "Breitenbücher", added 100 other entries - and then went through. OK, I got http 429, because of some API rate limits IMHO. |
Problem
The current implementation caches the related entries (references and citations) as soon as they are fetched after visiting the Citation Relations Tab. The fetched entries are held cached in RAM until JabRef is restarted. This approach unnecessarily bloats the computer memory and could result in an out-of-memory exception in special circumstances.
Suggested solution
Instead of caching all entries, we could cache the citation relations of the top N entries that are most likely to be visited in the future. The Least Recently Used (LRU) Cache operates on the principle that the data most recently accessed is likely to be accessed again in the near future.
Implementation details
The text was updated successfully, but these errors were encountered: