Bug 120154 - High RAM usage ( around 300mb for 10 mins and drop to 150-200 mb)
Summary: High RAM usage ( around 300mb for 10 mins and drop to 150-200 mb)
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice, perf
Depends on:
Blocks: Memory
  Show dependency treegraph
 
Reported: 2018-09-27 13:57 UTC by perie_gut
Modified: 2021-05-03 12:15 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
sample (573.66 KB, application/x-zip-compressed)
2018-09-27 13:57 UTC, perie_gut
Details
sample (650.41 KB, application/x-zip-compressed)
2018-09-28 10:08 UTC, perie_gut
Details

Note You need to log in before you can comment on or make changes to this bug.
Description perie_gut 2018-09-27 13:57:12 UTC
Created attachment 145214 [details]
sample

Steps:
1. unzip
2. Open the Report.ods. enable content. Memory will hover between 300 and 350 mb.
3. On the Header sheet, change the value (1- 12) of cell C3
4. On the sheet Dashboard, press control + shift + f9 to hard calculate. 
5. Monitor the memory usage for 10 mins. It will drop to 150 - 200 mb level. 
6. Repeat step 3. memory will not increase. 

Expectation.
Memory should not exceed 200 mb upon opening.
Comment 1 Oliver Brinzing 2018-09-27 16:30:14 UTC
i can not find a "Report.ods" inside the attachted *.zip archiv.
there is only a .~lock.Report.ods# inside.
can you plaese add the file?
Comment 2 perie_gut 2018-09-28 10:08:12 UTC
Created attachment 145249 [details]
sample
Comment 3 perie_gut 2018-09-28 11:19:43 UTC
Version: 6.1.3.0.0+
Build ID: 12b3395330953384bb80904fee489389db1e0cfc
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86@42, Branch:libreoffice-6-1, Time: 2018-09-23_16:09:50
Locale: en-PH (en_PH); Calc: CL

under this version, I cannot replicate the ram usage. 6.1.3 is even faster in updating the external links. The ram usage peaked at 185mb.
Comment 4 Oliver Brinzing 2018-09-28 12:20:36 UTC
with LO 6.1.2 on my win 10 notebook i can confirm:

- ram usage goes up to 500 mb
- hard recalc takes a long time (several minutes)
- with Tools/Options.../LibreOfffice Calc/Formula "Always recalculate"
  loading takes a long time too
Comment 5 Oliver Brinzing 2018-09-28 12:36:44 UTC
to be more precise:

selecting [Enable Content] from "Automatic update of external links has
been disabled" bar will increase memory usage (lo 6.2 ~ 330 mb, lo 6.1.2 ~ 500mb)
Comment 6 m_a_riosv 2018-09-28 17:57:36 UTC
Calculation time it's because in sheet 'Actual' you have the whole columns of external file to do a conditional sum. Reducing the end of range, reduce drastically the time calculation.
Comment 7 perie_gut 2018-09-29 04:30:12 UTC
(In reply to m.a.riosv from comment #6)
> Calculation time it's because in sheet 'Actual' you have the whole columns
> of external file to do a conditional sum. Reducing the end of range, reduce
> drastically the time calculation.

The point of raising this issue is the weird memory consumption of LO in a spreadsheet with quite number of linkages and formulas. My take on this is that if a LO spreadsheet will consume 300MB of memory, until the file is closed or saved, it will retain the 300MB. However in the current setup, after 10 - 15 mins of opening the file, the memory consumption went down and even if we hard recalculate all formulas, consumption is still lower compared to the first 10/15 minutes.
Comment 8 m_a_riosv 2018-09-29 12:32:01 UTC
There are a lot of linked files, that need to be opened and I think it's not only LibreOffice, but also an OS matter, how they are released from memory.

Test reopening the file after break all link Menu/Edit/Links
Comment 9 perie_gut 2018-09-29 12:49:28 UTC
(In reply to m.a.riosv from comment #8)
> There are a lot of linked files, that need to be opened and I think it's not
> only LibreOffice, but also an OS matter, how they are released from memory.
> 
> Test reopening the file after break all link Menu/Edit/Links

Does this mean that this behavior is beyond "repair"? And on the instruction to test reopening after breaking all links, NO! The very purpose of raising this issue is to identify/solve the weird memory consumption on a spreadsheet with multiple linkages. Your instruction is not helping in solving the "possible" problem in the memory handling of LO. Breaking all the external links means that as if I am working only with a single spreadsheet file.
Comment 10 QA Administrators 2019-10-11 02:36:28 UTC Comment hidden (obsolete)
Comment 11 Oliver Brinzing 2019-10-11 17:05:58 UTC
> - ram usage goes up to 500 mb

still reproducible with:

Version: 6.3.2.2 (x64)
Build-ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: 

but i think the root cause for memory consumption and "freeze" are the 14 linked files.
Comment 12 Buovjaga 2020-06-06 18:28:36 UTC
This is marked as a regression by the original reporter, but comments 3 and 4 are in conflict. Is the last good version known?
Comment 13 Buovjaga 2021-05-03 12:06:46 UTC
As discussed in the earlier comments, there is a good reason for the higher mem use in the beginning. Also asked in the dev chat just now. Closing as notabug.
Comment 14 Mike Kaganski 2021-05-03 12:15:28 UTC
We should never consider reports like "I monitor memory consumption, and in new version it's higher than on an older version" (or "it peaks then lowers after  while"). When looking at memory-related problems, the only ones that should be considered are those that result in crashes, or at least steadily growing memory consumption without releasing (leading to out-of-memory condition, indicating possible memory leak).

Change in memory usage pattern like described here *might* be e.g. because of changed caching (used at load time, and released after a timeout) - say, loading images, then off-loading them, which would not require to reload them on recalc; or many other things.

And of course, it is best to be consistent. The version shown in the bug "Version" field is 6.1.1.2, so it seems that that version was "problematic"; then comment 3 tells that 6.1.3 does not have the problem - "fixed"?; then comment 4 tells that 6.1.2 had this "problem" - so the "fix" was between 6.1.2 and 6.1.3 - but 6.2 is "better" than 6.1.2?; then comment 11 confirms *something* in 6.3.2.2...