Bug 62768 - Frequent crashes on large documents (Memory Leak ?)
Summary: Frequent crashes on large documents (Memory Leak ?)
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.1.2 release
Hardware: Other All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-26 15:53 UTC by Frederic Mestayer
Modified: 2015-04-24 17:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
150MB each save (2.46 MB, application/vnd.oasis.opendocument.text)
2013-03-26 15:53 UTC, Frederic Mestayer
Details
WinXP memory consumtion (51.35 KB, image/png)
2013-03-29 14:48 UTC, Frederic Mestayer
Details
Win7 memory consumption (61.44 KB, image/png)
2013-03-29 14:48 UTC, Frederic Mestayer
Details
Mac memory consumption (100.77 KB, image/png)
2013-03-29 14:49 UTC, Frederic Mestayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Mestayer 2013-03-26 15:53:25 UTC
Created attachment 77063 [details]
150MB each save

I'm writing a large documentation.
On each save, soffice.bin uses between 100MB to 150MB more memory, until 1.7GB, where it always crashes.
Seems that the "Save" process has severe memory leaks.

I'm using Windows7 64bits but i have the exact same behavior under Windows XP 32bits

I disabled ALL extensions, including dictionaries, and still, the same problem.

The document is available as attachment.
Comment 1 Frederic Mestayer 2013-03-28 09:46:34 UTC
I tried with the newest 4.0.2.2 today, and still the same issue.
On each save, the memory consumption of process soffice.bin goes up by 100MB to 150MB (until it crashes at 1.7GB)

Same behavior between Ubuntu and Windows.

The attachment has 160 pages with many images.
Wonder if it's related to them ?
Comment 2 Jacques Guilleron 2013-03-28 17:32:25 UTC
Hello Frederic,

No issue for me. I saved your documentation with LO 4.0.2.1 and LOdev 4.0.3.0+  (Build ID: 64a3b58a9ace11c6a01708e8de14712e27e0204).
Windows 7 Home Premium.

Have a nice day,

Jacques Guileron
Comment 3 Julien Nabet 2013-03-28 20:26:44 UTC
Do you reproduce this after having renamed your LO directory profile in both environments? (see https://wiki.documentfoundation.org/UserProfile). Perhaps there's something odd in it.

Did you install any specific fonts?

Just for the test, if you just add 1 simple character and save, do you see the memory consumption increase too?
Comment 4 Frederic Mestayer 2013-03-29 14:48:25 UTC
Created attachment 77215 [details]
WinXP memory consumtion
Comment 5 Frederic Mestayer 2013-03-29 14:48:48 UTC
Created attachment 77216 [details]
Win7 memory consumption
Comment 6 Frederic Mestayer 2013-03-29 14:49:07 UTC
Created attachment 77217 [details]
Mac memory consumption
Comment 7 Frederic Mestayer 2013-03-29 14:53:03 UTC
Hi,

@Nabet Julien :

Yes, the memory consumption grows each time i save, even if i only change 1 single character.
I didn't installed specific fonts, but some software should have put some ?

I made some screenshots for WinXP/Win7 pro/Mac which shows the same behavior...
On Ubuntu, i get 350MB after 4 saves.


The main problem, even if the growing memory usage is annoying, is that it very quickly reaches the memory limit on a 32bit system, and then crashes.
Comment 8 Julien Nabet 2013-03-29 15:06:58 UTC
Comment on attachment 77215 [details]
WinXP memory consumtion

Mimetype fixed
Comment 9 Julien Nabet 2013-03-29 15:07:19 UTC
Comment on attachment 77216 [details]
Win7 memory consumption

Mimetype fixed
Comment 10 Julien Nabet 2013-03-29 15:07:35 UTC
Comment on attachment 77217 [details]
Mac memory consumption

Mimetype fixed
Comment 11 Julien Nabet 2013-03-30 13:24:08 UTC
On pc Debian x86-64 with master sources updated today, I reproduced this problem partly. I mean, there are memory leaks but not 100MB each time.
I noticed that it was more and more each time.
First time, 1 or 2MB, then 4 or 5, then 10MB.
Now I don't think it's new to 4.0.1 but let's let this version for the moment.

I'll try to find some time to run it on Valgrind. If you're interested and have Linux, there's some quick guide here: https://wiki.documentfoundation.org/BugReport#How_to_get_a_valgrind_log_.28Linux.29
Comment 12 Frederic Mestayer 2013-04-03 14:52:54 UTC
@Nabet Julien
I've tested using a profile in another directory (basically, c:\temp\loprofile), but still the same issue.
Comment 13 Julien Nabet 2013-04-03 21:28:37 UTC
Sorry, I can't succeed in retrieving a Valgrind trace, it's far too slow on my laptop.
(i5, 6GB)

Michael: Any idea, how to retrieve useful info here?
Comment 14 Frederic Mestayer 2013-04-15 08:47:51 UTC
I divided the doc into 6 chapters to be able to work with it longer before crash, but it's really a nasty workaround, as i have to reassemble it each time i send it to someone...
That's really annoying
Comment 15 Michael Meeks 2013-04-18 12:15:19 UTC
Good question :-) There is a tool called 'memprof' that would work well under Linux - if it still works. That hooked malloc/free to work out who allocated what.

You would need a debuginfo build, and you would need to:

export G_SLICE=1

before running; and then - look at the memory profile; do the operation a few dozen times, and look at the profile again - attach both here (if only as screenshots or somesuch).

That should show you where the memory is allocated, but not freed (if memprof still works ;-).

And yes valgrind runs around 80x slower (minimum) than the real CPU.

Thanks !
Comment 16 Julien Nabet 2013-04-18 13:09:19 UTC
(In reply to comment #15)
> ...
> And yes valgrind runs around 80x slower (minimum) than the real CPU.
It reminds me about http://nabble.documentfoundation.org/Alternative-complementary-to-Valgrind-with-MemorySanitizer-ThreadSanitizer-LLVM-td4020696.html. I remember that with Valgrind, I couldn't succeed in retrieving something with doc attached (really too slow). Do you know if Stephan or perhaps Lubos gave it a look?
Comment 17 QA Administrators 2015-04-01 14:42:43 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

   *Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.1 or later)
   https://www.libreoffice.org/download/

   *If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior
 
   *If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

   *Update the version field
   *Reply via email (please reply directly on the bug tracker)
   *Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 

1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug 
3. Leave a comment with your results. 
4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 
4b. If the bug was not present in 3.3 - add "regression" to keyword


Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for your help!

-- The LibreOffice QA Team This NEW Message was generated on: 2015-04-01
Comment 18 Buovjaga 2015-04-24 17:28:28 UTC
Doesn't seem to be happening anymore. Saved modifications to attachment 77063 [details] several times and memory hovered at 130MB, not increasing.

WFM, set back to NEW, if someone still sees this.

Win 7 Pro 64-bit Version: 5.0.0.0.alpha1+ (x64)
Build ID: f3375fa07f27bd2ade519af3c07d69040d10eaa9
TinderBox: Win-x86_64@42, Branch:master, Time: 2015-04-22_23:38:50
Locale: fi_FI