Need help with temporary files

Matúš Kukan matus.kukan at gmail.com
Thu Jul 23 20:55:13 PDT 2015


On 22 July 2015 at 13:07, Caolán McNamara <caolanm at redhat.com> wrote:
> On Wed, 2015-07-22 at 10:43 +0100, Caolán McNamara wrote:
>> On Wed, 2015-07-22 at 10:28 +0100, Caolán McNamara wrote:
>> > On Tue, 2015-07-21 at 22:41 +0200, Matúš Kukan wrote:
>> > > Hi there,
>> > >
>> > > I am working on a bug around saving big file in Writer:
>> > > https://bugs.documentfoundation.org/show_bug.cgi?id=88314
>> > >
>> E_MFILE, too many open files, so the problem is a file handle leak.
>
> See https://gerrit.libreoffice.org/#/c/17289/ for a possible solution.
> That odt has > 14k files in it and in parallel deflate mode each one
> gets a separate ZipOutputEntry which all exist at the same time until
> the threads are completed. Each ZipOutputEntry has an open temp file so
> it runs out of file handles.

Yay - thanks for explaining what's wrong and even fixing the bug.
I don't have much time to play with LibreOffice these days. :/

Your patch looks good, except we still open files in main thread,
so in theory, there can be still many files opened at the same time?
But it seems to help, commented in gerrit.

> So what works for me, though maybe it destroys the perf gains, is to
> close each entry's output stream after its processed and reopen it when
> we need its data.

I would not worry about the perf effect, at least I don't have better solution.
This is nice fix.

Thanks a lot.

Matus


More information about the LibreOffice mailing list