Dolphin and releasing memory

Are there an issues with Dolphin not releasing memory after being closed?

I’ve been running SQLite queries from the CLI using the .read method and some Tcl scripts using tclsh.

I noticed that the memory usage appeared higher than expected and found that there were 32 Dolphin processes from 25 MiB to 50 MiB each. After closing Dolphin, the processes remain. I closed System Monitor and re-opened it, and it then showed Dolphin in Applications using 1.6 GiB but I closed it before that. I also closed Konsole (SQLite and Tcl).

I’ve been working with two desktop views and had Dolphin open in each view at some times.

Is this expected or could I be doing something wrong to cause it? Thank you.

I forgot to write that I also have Kate open in two desktops. When I try to close Dolphin from within System Monitor, it warns that unsaved work could be lost. What work is it referring to? If there is an issue in Dolphin, but I save my work in Kate, it will still be saved; will it not?

What do you mean by “two desktop views”? Do you mean two distinct user logins?

I’m afraid I cannot reproduce this. I have only one dolphin process running, and it only consumes 63 MiB of virtual memory. :man_shrugging:

I suspect that your SQL queries may have something to do with it.

That’s a standard warning whenever you are trying to close an application from within plasma-systemmonitor. :wink:

Yes. :wink:

Do you use the built-in konsole in dolphin?

From a developer point of view - and I have dealt with a fair share of programming related memory issues over the years - a memory build-up can be caused in several ways.

On Linux file system cache contributes to memory usage. This usage will be released ad-hoc when it is no longer needed.

sqlite is a database - most often consisting of a single file - so when you query the database the file will be cached.

Another cause is how the programmer deals with the objects created to query the database. Many modern languages like rust, python and c# has automatic garbage collection, yet is is still good practice to have a using or with declaration to have the language clean up automagically.

When an sqlite object is created to communicate with the database, then you open the connection, use another object to query the database, reading the data into a third object to process the data. If the record set is not released and connection is not closed you may leave dangling objects. If you start enough instances - it may become a problem.

I started my developer merits by building applications for DOS using Quick Basic 4, later it was Visual Basic on Windows 3.11 - and back then, releasing memory was important, one learned to close database connections and record sets to avoid crashing the system.

1 Like

Thank you for the answers.

I apologize for not learning the proper terminology and am referring to the rectangular icons (near the big K on my screen) that toggle between Desktop 1 and 2. Just one login.

I just closed it from within System Monitor and it appears to have released the memory and I see not more Dolphin processes.

Just out of curiosity, what does Dolphin have to do with executing the SQL queries? They are edited in Kate, run in Konsole through SQLite3 or a Tcl script that requires SQLite, and they change a SQLite file on disk (sometimes using an in-memory database to help). I assumed Dolphin was just an application to help locate and organize files, but not execute them. But I don’t know how any of that works. I mean SQLite and Tcl have to handle releasing memory that they allocate, but, if they failed to, the OS should free it when they or Konsole are closed. Does Dolphin allocate memory?

Thank you. No,I do no use the built in Konsole in Dolphin.

But I also run a Tcl application from Konsole such that I can write data to stdout while using the application to debug and monitor. I keep terminating the program, edit some part of it, and start it again from within the same Konsole. And then check the database tables in another Konsole instance to see how the Tcl application is changing the data.

But, if I make a mistake in my program that results in not releasing memory, once I close Konsole, shouldn’t the OS release it all?

Thanks.

The OS has no way of knowing if the object is garbage or not…

File system cache is transparent - and handled by the OS - your sqlite objects is handled by your application.

//EDIT::

This could leave objects in memory - if you do not catch the termination signal in code and from within the function - explicitly clean all instantiated objects.

On my system a single Dolphin instance occupies around 65 MB memory.

Using the builtin konsole (F4) adds only 1MB without adding a konsole instance to the process listing.

1 Like

This is an important and astute remark. :+1:

When using the built-in terminal of dolphin, closing the terminal or closing dolphin will not stop the shell started that way. One has to stop it by typing exit or hitting CtrlD at the prompt.

Okay, thank you. Let’s suppose it is true that closing my application somehow results in memory not being released. Why would that result in an additional Dolphin process or involve memory usage in Dolphin? Should it not be memory used by Konsole since the application is started using something like tclsh start.tcl on the command line?

I’ve been building like this for the past three years and never saw this before in Dolphin; but I could have made a code change that just started to cause it, too. I suppose if I do nothing in Dolphin while working on the application and no new Dolphin processes appear in System Monitor, then I can rule out that they were the result of my application being abruptly closed.

The only other thing I can think of is that I’ve been backing up a 15 GiB SQLite file to USB the past several nights. It runs to completion without issue (maybe 3-5 minutes duration) but I have not checked System Monitor immediately thereafter. I will try that again later today just as I usually do it. I really don’t need to do it that way and could attach the database on the USB to the same Konsole connection and write only the tables that have changed. But it’s easier to not worry about it and just write the file. Thanks.


I just remembered something else also. I have Dolphin open in each Desktop to different folder locations. Insert the USB, and a new Dolphin window is opened but not an empty one, a duplicate of the existing one with an added tab for the USB drive or it remembers what was open in Dolphin the last time the drive was inserted. After the writing to USB completes, I generally close the Dolphin tab that has the USB path open and close that Dolphin window before removing the USB drive; but sometimes I forget and remove the drive before closing the tab and/or window. I remove it correctly and only after the system states it is safe to remove it but I leave that Dolphin window open until after the drive is removed. I’ll try testing that later also, especially since it is directly related to Dolphin “work.”


This might be easily reproducible
With two Desktop windows open and Dolphin opened in Desktop 1, if I open a new Dolphin instance in Desktop 2 a new process is created; but, when the Dolphin instance is closed, the process remains. If that is repeated, several processes remain even when Dolphin is not open in Desktop 2 and even if close it in Desktop 1 also; and System Monitor shows Dolphin open with several sessions worth of memory being used. Sometimes Dolphin does not show up under Applications in the Overview tab of System Monitor but does in the Applications tab. I closed System Monitor and re-opened it (just in case the process list was not being refreshed) and Dolphin still appears and with a large memory usage. I tried it on my desktop and laptop with the same results.

Should those processes end when each instance of Dolphin is closed or at least when all instances have been closed in both Desktops?

Once in this state, Dolphin can be closed from within System Monitor and all the processes then end.

Does anyone else see this occurring or, perhaps, I have somethng set up wrong?

Thank you.

This is not an operating system issue and dolphin is affected because you use dolphin to launch your application.

This behaviour indicates that processes started is originating from dolphin.

This can have any number of causes - most likely it is an application executed from the dolphin file pane.

As I suggested above - the application does not cleanup properly - e.g. by intercepting a termination signal - parts of the application started by remains in memory - and since the application was started by dolphin using the file pane - the process appear to be dolphin itself.

The behaviour is a typical memory leak situation created by a faulty application but you see it as a dolphin issue.

This is not the case - dolphin is merely a victim here - the real culprit is the behaviour of you application and the fact that you deliberately terminate your application without doing proper cleanup.

I reboot the system. I open no applications but Dolphin and System Monitor, and do not open any files. Just open and close Dolphin and watch System monitor and the Dolphin processes increase as does memory usage. Those proceses do not end when Dolphin is closed.

My application can have nothing to do with the above scenario.

If this does not take place on your system, can you tell me how to figure out why it happens on mine?

Thanks.

I have no idea what may be causing it on your system.

As for my system using unstable branch - dolphin package version is 25.04.2-1

If your system is using stable branch - the dolphin package version is 25.04.1-1

Whether this has any bearing in the issue at hand - I cannot possibly say.

Thank you. I am using stable branch and all my configuration settings appear to be the defaults. I have it recall the open tabs at start but I tried switching that, and it still keeps the process after closing.

When you wrote “…because you use dolphin to launch your application” and I had already written that I open it from Konsole using tclsh start.tcl, do you mean that Konsole and Dolphin are “connected” even if Konsole is not opened through Dolphin?

I ask because I try to follow memory used by the application but it’s a bit hard to follow in System Monitor.

Sorry - somehow missed that

No that is not what I meant but what I meant have no meaning now.

To deduce whether it is a memory leak with dolphin - which may have been fixed with 25.04.2 - I suggest you try switching branch - run a full system sync and restart your system.

Then verify your observation - other than that - I have nothing more to offer.

As for system monitor - try using the application → Show Details Sidebar - this will show the processes owned all processes for the selected application.

Likewise processes can be filtered to show user process only - could be the default.

I didn’t change to unstable branch on my working machines but I have an older machine that I keep around to test my application’s responsiveness on an HDD and less RAM which I haven’t updated in a little while; I think May 11th was the last time I ran updates on it.

Anyway, it has Dolphin version 25.04.0-2 and does not have the issue. All Dolphin processes close when each instance of Dolphin is closed, whether on the same or different desktops.

That’s not exactly definitive since it is a different machine but it appears that something changed between 25.04.0-2 and 25.04.1-1 and 25.04.2-1.

At some point, I may try unstable branch and it may be safe and simple but I haven’t time to risk causing issues that require time to solve.


The recent update to 25.04.2-1 on stable did not resolve this on my two machines. I have the Extra Dolphin plugins installed but did not uninstall it to see if that makes a difference.

1 Like

I have been watching my usage of dolphin and I have see no indications of rogue memory.

Since the circumstances under which you experience this, is during application development and debugging; without access to the same environment your application generates; it is impossible to provide a solution for your issue.

I don’t think this is related to dolphin in general but is a combination of your hardware and how you interact with the system through your application during your development and testing cycles.

I previously vented the thought that your development cycles - how you test - may be generating the issues.

2 Likes

There may certainly be something different or particular to the set-up of my machines, although I’ve no idea what that might be since I stick to the Manjaro repository (apart from a small number of items like tdom) and stable branch.

Since the circumstances under which you experience this, is during application development …

As stated in the earlier posts, this takes place with my application closed; for it takes place immediatley after reboot when no applications are open except Dolphin and System Monitor. (I don’t know what else could be done to demonstrate that this is not due to my application except to delete the application files from the machine.)

After installing updates, using the advice of your post on how to safely install updates in TTY, I shut it down (not just a reboot) and turned it on, opened System Monitor, and then opened an instance of Dolphin and closed it, and observed that the process remains. Repeat that in any way you like–that is, one instance open at a time and then close, or open mulitple instances and close–and the number of processes increases and remain after all instances of Dolphin are closed. The only way to get rid of them is to kill Dolphin from within System Montior even though all Dolphin windows have been closed. I tried closing and reopening System Monitor and the processes are still displayed.

This does not occur on the older machine I mentioned that has not been updated since early May and still has Dolphin 25.04.0-2. And that machine has my application on it also. After a Dolphin window is closed, in about 3 seconds the process is removed from the System Monitor display.

I don’t know the answer and I may have unknowingly done something stupid to have caused it, but it appears wrong to conclude that it must be my application since the application need not be running to observe this.

All machines use the 6.12 kernel. The older machine has an HDD and the other two have SSD. All are HP machines, nothing custom built nor any hardware added to them afterward.

Is it possbile to install an older version of an application? Can I install the old 25.04.0-2 version of Dolphin and see what takes place? Would that even help get to an answer if the processes are closed in that version?

Thank you.

I am not saying you are not having strange issues.

What I am saying is: I am not able to reproduce the behaviour (dolphin rogue memory) during my normal use.

Therefore I am concluding that it must be something local to your environment; I am not able to provide any more ideas on how or why it occurs on your system.

Due to the rolling nature and the tight coupling of Plasma components; I would advise against installing older versions of any application but stay with the versions from the official repositories.

Mixing like what you suggest may introduce other strange issues; making it even harder to troubleshoot.

I don’t know how to isolate the cause (and can no longer do so since updated the system today) but do know that the recent update to Dolphin 25.4.3 appears to have eliminated the issue. Any number of Dolphin instances may be opened across multiple desktops and, after each is closed, a process is removed from System Monitor in about 3-5 seconds; and, when the last instance is closed, all processes are gone and the application is removed. And it behaves the same for kernels 6.12 and 6.15.

The only thing I may have done differently at update is selected to use the core/linux meta option. I’m not sure I did that before or not.

Whether this means it was an issue with Dolphin or an update to some other application on my system, I don’t know. But at least it appears to be releasing the memory again. I did not add/remove anything from the system.

1 Like

Thanks for reporting back. :+1:

I have marked your own post as the solution to highlight that, at least in this instance, a little patience has proven worthwhile.

Good to know you’re back on track.

Regards.

1 Like