https://bugs.kde.org/show_bug.cgi?id=398908

Harald Sitter <sit...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kdelibs-b...@kde.org,
                   |                            |sit...@kde.org
             Status|REOPENED                    |CONFIRMED
          Component|general                     |general
           Assignee|dolphin-bugs-n...@kde.org   |kio-bugs-n...@kde.org
            Version|18.08.0                     |git master
            Product|dolphin                     |frameworks-kio

--- Comment #84 from Harald Sitter <sit...@kde.org> ---
There are at least two problems here.

a) when we try to determine the mimetype of a file it runs through
MimeTypeFinderJob which effectively calls ::get() on the backing KIO worker,
that function then sends the mimetype and starts reading the file. This is
problematic because it reads data we never need, wasting energy on entirely
pointless data copying from disk to worker memory, to socket, to client memory.
In case throughput is large enough (which it can easily be with e.g. nvme
drives) this effectively reads the entire file into memory while mimetype
reading is going on, causing a **temporary** spike in consumption. This is
fairly horrible and really needs to be changed for the sake of the planet.

b) Something then gets confused and doesn't detect the memory getting freed. I
say confused because according to the heaptrack recording of comment #82 the
actual user space heap returns to 10mib. I do however definitely see the smaps
file in /proc reporting a much larger heap. My theory here is that this
actually is connected to a). The way I understand it the TransferJob inside the
MimeTypeFinderJob would get discarded when the MimeTypeFinderJob finishes. My
theory is that this then leads to the socket that was talking to the worker to
have dangling data in kernel space. i.e. the socket has pending data that we'll
never (?) read.

I'll move the bug to KIO for further inspection. My recommendation would be to
split mimetype detection away form ::get() and then see where we are at.
Chances are this fixes b) implicitly because the kio worker wouldn't keep
streaming useless data that can get stuck in the pipes.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to