High VIRT memory used by file manager

0

I'm using elementary OS and it's default file manager Files.

I've noticed that after a while of usage, htop shows that pantheon-files (how the app is named) consumes over 10Gb of VIRT memory.

This value increases every time I open an image and never seems to stop.

I'm not familiar with VIRT memory management so my question is: is this behaviour expected and/or somewhat normal for a file manager? Or is this a memory leak?

Gabriel

Posted 2015-06-23T13:15:37.617

Reputation: 508

Answers

1

It's neither expected nor normal. But there is absolutely no reason you should care. You should not have particular expectations about how a a file manager uses virtual memory. And I don't think there are usage patterns that are particularly normal or abnormal.

It's all going to come down to tiny design decisions. Do you memory map files? When do you unmap that?

There is no reason anyone should care absent evidence there's some kind of problem. Virtual memory on a 64-bit OS is so ridiculously cheap that there's absolutely no reason you should try to treat it as a scarce resource. You can make tradeoffs entirely in the other direction, and programmers do.

David Schwartz

Posted 2015-06-23T13:15:37.617

Reputation: 58 310

Thank you David, your explanation makes this a bit clearer. I actually do care since after a while of usage, Files stops opening files anymore. – Gabriel – 2015-06-24T12:28:10.443

@Gabriel You should investigate that or ask about it. – David Schwartz – 2015-06-24T12:29:14.553

Yeah, I've filed a bug report. I just wanted to learn a bit more about this VIRT thing. Cheers. – Gabriel – 2015-06-24T12:30:25.383

1

I'm not familiar with Elementary and Files, but this is normal for processes in general. The VIRT refers not (necessarily) to physical RAM used, but what the size of the mapped address space is for that process. This address space will include physical RAM, shared objects and files open on disk, etc. For example, dropbox-3.6.7 on my PC VIRT = 3GB, but RES = 100M, i.e. 100MB physical memory is in use, and ~3GB files have been accessed. If there was a memory leak you'd likely see RES increasing slowly. If you like take a look at this document on TLDP, it explains everything rather well.

VIRT = Virtual process size. RAM, files, everything.

RES = Resident size in physical memory

SHR = Amount of VIRT which is shared, i.e. can be used by other processes.

HTH!

Hygrinet

Posted 2015-06-23T13:15:37.617

Reputation: 359

This seems to contradict David's answer about this behaviour not being normal. – Gabriel – 2015-06-24T12:25:37.870

1@Gabriel He's talking about processes in general. I'm talking about file managers specifically. But it doesn't matter, there's nothing wrong with acting in ways that aren't normal if it's a result of sensible design decisions. "Normal" does not mean good. Plenty of bad things are normal, and plenty of good things are not normal. – David Schwartz – 2015-06-24T12:30:22.780

Indeed - what is normal! – Hygrinet – 2015-06-24T12:33:05.790