-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[LO add-on] Latest nightly ate 24 GB RAM - 2023-03-10 #8012
Comments
|
This error is a mystery to me. Marco sent me a log file stating that the maximum heap space was 7262 MB. The extension limits itself and switches to a fallback mode at approx. 6500 MB, which releases all additional interfaces and deletes the cache. In principle, it is therefore impossible for the extension to allocate 24 GB of storage space. I am completely at a loss. @danielnaber do you have an idea for that? |
|
By the way, I couldn't reproduce the bug. |
|
@marcoagpinto I did a bug fix. Please test it tomorrow. |
How does it do so? Doesn't this depend on the JVM settings in LibreOffice? |
|
The application test it: Runtime.getRuntime().maxMemory() |
And how does it use that value then to limit the memory use? I don't see that in the code. |
|
The methods MultiDocumentsHandler.isEnoughHeapSpace() and MultiDocumentsHandler.testHeapSpace() test if more the 90% of heap space is reached and do the switch to another mode. |
I see, but I don't know what the issue could be. Maybe it's not really the JVM that's taking the memory, but LibreOffice? |
|
I tested today's nightly, and it kept on crashing. The RAM usage also increased to 16 GB in just a few minutes, and I had to close LibreOffice. I sent the log via e-mail. |
|
Maybe you are using the total RAM size instead of the heap RAM size? |
|
The log-file @marcoagpinto sent to me shows a bug. This has to be fixed, but it will take a little time. I won't be able to look at this until the end of the week. |
|
@marcoagpinto I still managed to resolve the problems in the log file. Please test it tomorrow. Please send me the log file. |
|
Thanks, I will test tomorrow night. |
|
I have sent you the log file via e-mail. The memory bug is still present, and the log shows numerous errors. Thanks! |
|
The problems that the log file shows are solved. |
Once the problem occurs, you can get a stack trace using |
|
@marcoagpinto: Did the last change solve the problem? Are there any bug reports in the log-file? |
|
I tested it days ago, and it only consumed ~7 GB of RAM for my near 600-page thesis. The size was increasing very slowly, but I believe it is fixed, thanks! I haven't looked at the log file. |
|
I was just checking the ~600-page thesis. The log seems clean: However, as I scrolled down the document, the RAM usage is increasing and when it reached 16 GB I closed LibreOffice. |
|
Hello! Any news regarding this? Have you checked if you are using the computer RAM in the code instead of the Java RAM? |
|
I've just posted an update of the LT extension. It solves a problem with the integration of the additional LT spelling files into LO spell checker. In the past, this had triggered unexpected side effects. I'm uncertain if it solves your problem, but please test the new version and give me feedback. |
|
I am very sad… 😢 😢 😢 😢 😢 😢 😢 😢 |
|
@marcoagpinto I'm very sorry, but I have no idea. There are two strange things: Did you test to load your document into LO with deactivated LT? You could open the extension manager, deactivate LT, restart LO and load your document. If the memory grows in the same way, there is a bug in LO and you have to contact the developer. If the error only occurs when LT is installed/enabled, then we need to figure out how to find a solution. |
|
Yes, a week or two ago I removed LT from the extensions and LibreOffice didn't consume much RAM. I am not sure if this helps, but the thesis has hundreds of figures and dozens of equations and tables. Thanks! |
|
See the attached docx where I tried to kind of simulate the thesis. The RAM usage increases until 8 GB and then slowly it starts to decrease. Does it help? Thanks! |
|
My wild guess is that it may be related to the IEEE bibliography. After I added it to this DOCX, the RAM usage doubled or tripled. In my thesis, I have over 400 bibliographical entries in IEEE format (dozens of pages of entries). But it is just a wild guess. |
|
Ahhhhh… the spelling mistakes, I had turned on the rule for unknown words to appear underlined in black. So, LanguageTool had to underline all the words I added to standard.dic, I am uncertain if this information is important to you. There were dozens, many dozens, probably of words to be underlined in black. |
|
I had to change back to an older version because of some side effects. But I did some other optimization. Now, there is no idea left, I fear. |
|
I will test it tomorrow night, since the nightly for today doesn't include the changes you have done minutes ago. Thanks! |
|
Heya, Fred, I created a blank profile on LibreOffice for the test. I was running my thesis for around 30–40 minutes and the RAM usage was stable at around 7 GB. I disabled only two rules and enabled three or four. Now and then I would scroll down. I reached a figure and LibreOffice closed (probably a bug in LO). I reopened the thesis and started scrolling down quickly now and then and the RAM usage started increasing until it reached 13-14 GB and I closed LO. I had it open for another around 40 minutes when this happened. I looked at the log file and, compared to the previous one, it looks clean, except it has Could you give one last try to fix it? Maybe fixing the Then, we could release a 6.1.1 probably, what do you think, @danielnaber ? Thanks! ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ |
|
This thesis is being very demanding, for both of us. |
|
Hi Marco, I'm on vacation. I can work on this issued not before end of next week. I think we should release a version 6.1 as it is, because it solves many other bugs and it runs very well with "normal" texts. I feel, to get your thesis run will take awhile. |
|
Sure, Fred. Happy Holidays! |
… of SpellChecker service and resolving a bug in text level queue - related to issue #8012
|
I made some optimizations on a deep level of a LO interface. In my test documents, the check now runs much faster and uses less memory. Please test the new version. |
|
I will test tomorrow's nightly. Thank you for all your hard work. |
|
This is terrible. The memory usage seemed stable in my thesis at around 4,1 GB. After I added one word to the standard.dic with a right-click, I have the rule that underlines unknown words in black, the memory usage doubled in just a minute or so, and I had to close LibreOffice. Log: |
|
Hi @marcoagpinto, this update solves the null pointer exception above, but not the memory problem. |
|
Thanks! |
|
I opened a ticket in LibreOffice's Bugzilla: |
|
Hi @FredKruse, could you please provide some kind of minimal reproducer (in Java, or in Basic, or just list a sequence of UNO calls) to get the problem in LibreOffice? I assume that some service instance is created, then destroyed on your side, but not on LibreOffice side? So possibly some kind of a simple loop of creating and destruction of the service could be such a reproducer. Either here, or in the bug report that Marco created, would be great. Thank you! |
|
Hi @mikekaganski, I built a dummy proofreader as LO extension. It does no real proof and no marking. It gets all XFlatParagraphs using the method "getNextPara" to get an initial paragraph and after that "getParaBefore" and "getParaAfter" from XFlatParagraphIterator and stores it in an ArrayList. The whole procedure is running in a loop. After the whole document is stored as XFlatparagraphs, the list is emptied and the XflatParagraphs are called and stored again. The loop runs 10000 times per paragraph. |
|
Thanks @FredKruse. |
|
Here is the source code: |
|
Indeed, the iterator has this curious https://git.libreoffice.org/core/+/master/sw/source/core/inc/unoflatpara.hxx#127 ... and each and every instance of flat para gets there, such as in getParaAfter: https://git.libreoffice.org/core/+/master/sw/source/core/unocore/unoflatpara.cxx#536 Why do we need them... |
|
As far as I see, there is an insertion of an XFlatParagraph at any operation into the list m_aFlatParaList. But the list will not be emptied anywhere. On the other hand, I couldn't find any reference to that list. So, it should be removed, I think. |
|
@mikekaganski has committed a patch for LibreOffice 7.6 on Gerrit. It will be available in 24/48 hours. Fred, could you in a few days download the latest LibreOffice 7.6 nightly and check if it is fixed and if there is no need any more for a hack in LanguageTool? Thanks! |
|
I created a workaround on the base of the discussion above. |
|
Sure Fred, I will test it tonight at around 7pm or 8pm. I will report here the results. Notice that yesterday I tested yesterday's night, and it was consuming (and increasing) tons of RAM just by having my thesis open. |
|
I believe that the memory issue is resolved. I opened the thesis with LanguageTool settings in default (“set to default”), multiple core, activated manually some rules. The maximum RAM it consumed from the 32 GB was 8,4 GB, but when I finished scrolling through the ~600 pages the RAM usage by LibreOffice was only 6,976.6 MB. I spent over an hour with the thesis opened. There is still a “null” in the log: One thing I did notice is that adding words to the standard.dic with a right-click increased the RAM usage in 100s of MB or even 1 GB per word (still not fixed, or it is normal?). I only added two words to standard.dic and with the unknown words rule enabled and with the colour black. After adding the words to standard.dic the CPU load increased to the rate of 20 something percent for a long time. But I guess it is good for the regular user if it passed my thesis test 😄 😋 … my thesis isn't an easy document. Thank you! |
|
I will close this issue as solved. Open a new issue with current versions if necessary. |








Hello @FredKruse ,
I tried the latest nightly and my computer RAM was almost 100% used (32 GB).
When I noticed that the computer was terribly slow, I opened task manager and LibreOffice was taking 24 GB of the 32 GB of RAM.
I sent you the log file via e-mail.
Could you take a look at it?
Thanks!
The text was updated successfully, but these errors were encountered: