(bug)total commander 3 beta 8 --- memory leak

Support for Android version of Total Commander

Moderators: sheep, Hacker, Stefan2, white

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

(bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-16, 06:57 UTC

Occasionally ,I found on some moves.
I was pick albumart for music player, it raised system document manager ,then I chosen total commander that at left side of document manager.

After about 100 times pick and chose,I return to web browser.Then I found browser was killed.
That time I didn't run much app with about 2G memory free.

I got to running service and saw total commander eat 1.5G memory.

So,I think there's something goes wrong when you use total commander to phase path for other apps.(function ok,but memory eat a lot if do many times.)

I'm on android 9.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37695
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *ghisler(Author) » 2019-09-16, 13:21 UTC

There are currently no known memory leaks in Total Commander. Also apps are usually limited to 128 MB or 256MB, so it's not even possible that TC could eat 1.5GB...
Author of Total Commander
http://www.ghisler.com

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-17, 02:35 UTC

I just did it again over and over picking albumart for one album.(still 1/3 to go,but I stopped ,result shows enough)
Here is the result.
See the screenshot below.
Image: https://imgur.com/a/9LUg4Tg


FYI,I had similar situation long back to android 2.3 that with app " bluedict".
That app popup a search result(not the main activity ,it's a part activity ) overlay other app when you share searching word to bluedict.
And when you do that again and again ,app just eat up memory ,that time makes phone lagy.
At last ,the app developer solved this by exit progress itself when you push back button everytime when you switch popup overlay activity back to app that you share from.

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-18, 02:39 UTC

I just found there are 3 tombstone files that are TC's.
And I check the time I did this operation.It's near but not exactly.
Most possibility is self crash?I didn't manually kill the TC after that test.
If it is useful,I 'll post here.But I hear checking tombstone is not that helpful and reading it is a painful thing.


After all,this is not a serious problem.I do this only after flashing new roms,changing phones.
Normally,to provide path for other app from TC is only several times.That time is ok.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37695
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *ghisler(Author) » 2019-09-19, 09:39 UTC

Do you think it's related to album art? Try disabling thumbnails in main menu - confiugre - Thumbnails.
Author of Total Commander
http://www.ghisler.com

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-19, 14:05 UTC

No,I don't think it's related to albumart although i'm not a programer.

Although you turn off thumbnails in settings of TC ,the system documentui called by music player that shows the provider apps still show the thumbnails.

And more ,I did exactly the same progress of last time but the path provider is the app picfolder (com.alensw.picfolder 3.4.9.1).
Result see the screenshot:
Image: https://imgur.com/a/T5jNJXB

And I found you don't need to try that many many times.
After several times ,like 10 ,you'll see the TC memory using is arising compares to picfolder that almost the same memory using.

All done the same ,the different is just the path provider app.

Another thing is about "copy and move".
"move files" now is kind of slow.I mean in the internal storage to the internal storage.
I didn't search the forums that someone already mentioned.If so,sorry to brought up here.

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-19, 21:01 UTC

I think the problem is that TC's path provide activity is not properly released after it ended.
So ,possibilities in code:
1. the method of path provide activity is outdated.
2. at the end, missing the right code after this activity is been called.
3.at the end, the code of ending this activity is there but the method is outdated.

If above are all in the right way ,then maybe the android thing.
And the solver maybe use image related specific path provide api. That result for TC is add another path phase.
I see there is already two there:
Total Commander
TotalCmd(file://url)
(above all tests are using "Total Commander")
(just do the same using "TotalCmd(file://url)" ,each time increases memory using about 10MB ,so the same problem)
(just disabled "com.android.documentsui" ,then the system show the path provider is like a "share to" activity, result for TC is the same)

Maybe it's need to check this part of related documents , but I don't know the specific details.

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-20, 04:24 UTC

Update:
Actually,I just do a little more to target where might be the place that problem occured.
You don't need to pick up file to complete the albumart selection,just bringing up the folder that provide the path to is already keeping up the memory.(just you click the "Total Commander" or "TotalCmd(file://url)" ,the memory just starts stacking)
I think there maybe should have some code when it leaves the popup activity when hit back button or hit the file that want to select .That time should the popup activity of TC be destroyed.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37695
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *ghisler(Author) » 2019-09-20, 13:32 UTC

Where is the folder located?
What does it contain?

I ask because I cannot reproduce the problem here.
Author of Total Commander
http://www.ghisler.com

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-20, 14:55 UTC

playerpro (com.tbig.playerpro version 3.84)
in the albums view ,long click the album that you want to add albumart, at the right top ,click that three dots menu ,then click "Manage artwork"
(or use your favor music player that can manually modified albumart )
Image: https://imgur.com/a/fL3awRF

then this time still in the app playerpro ,click "Pick from Gallery "
Image: https://imgur.com/a/YiZD2H2

popup path provider apps
Image: https://imgur.com/a/j4pXGjA

click "Total Commander ",brings to my albumart backup folder ,where all of small pictures. so you can just lead it to a picture stored folder.
When this activity of TC shows ,it means TC is starting to stack memory that above I mentioned.
Image: https://imgur.com/a/pshyqYu

click back button ,and go to check TC memory using
Image: https://imgur.com/a/upLeNWm

repeat 3 times
check TC memory using ,it's arised ,and it increases lianer ,repeat again and again ,it eventually reaches high memory using.
Image: https://imgur.com/a/upLeNWm



I just test another one ,that choose a folder contains only one picture.(need to select it once to be the default folder showed by popup activity of TC)
let's just say TC cached 100MB ,after popup activity that shows only one picture contained ,TC cached 108MB ,and 1second later ,TC cached 102MB automatically.
So,it's not that obviously if the folder contains less pictures.
It increases slowly due to every time the activity uses less resource that less pictures need to cache.
So,my guess still is the action how to deal when leaves the activity ,not the thumbnail thing.

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-20, 21:43 UTC

update:
Now I think it might be the thumbnail problem.
I do following:
select words from webpage in the browser app,
share it to "Total Commander", TC popup a similar activity with one more line "save the file as" at top.

When I save to a folder without any picture ,the problem no longer occurs.
But when I save to a folder contains pictures ,the problem shows up again.
So,it might not the activity ,it's the caching thumbnail(or image) that not properly handled after exiting this activity.

In the main activity of TC,when you go into a folder with pictures ,TC will cache them ,and no matter you exit that folder and go in again ,or hit back button to leave TC and open TC again and go to that picture folder ,TC will not caching them again.(I don't know the professional saying about this,just the memory using will not increase.)
But not in that popup activity of TC provide,that time TC will cache the picture thumbnail again and again leading to consume the memory.


Update2:
Now much for sure it's the thumbnail thing.
I do following:
Before,when dealing with music player ,I had to put at least one picture in the folder that can make the next TC's popup activity remain in this folder.
So,I can still see the TC memory consuming.
Now,this time I put one picture to ensure TC's path provide activity in this folder as default.
Then I go to main activity of TC ,go that folder ,delete that only one picture.
Then repeat the progress ,so everytime the popup activity of TC showing a folder without any picture and this still the same progress that I want to reproduce the problem when dealing with music player.
Now ,the problem can't be reproduced which means in this situation TC's path provide activity works fine.

So, no picture no thumbnail ,TC's path provide activity is fine.
but this activity dealing with pictures causes memory consuming.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37695
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *ghisler(Author) » 2019-09-23, 13:29 UTC

How many files are in the folder with pictures?
Author of Total Commander
http://www.ghisler.com

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-24, 03:37 UTC

exactly 100
and memory increase step is 5MB to 10MB each time of open that activity.
(before is 9MB-10MB,but afterwards test shows first 9-10MB then decreases to 5-6MB in 3 seconds,don't know why)
(also ,I think related to total physical memories,my phone has 4GB,and if like 2GB phone the step would be lower(due to android ,the same app would use more memory on larger memory phones))

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37695
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *ghisler(Author) » 2019-09-26, 13:18 UTC

How many megapixels are your images in that folder? 10MB would be about 3 Megapixels (with RGB=3 Bytes per color) unpacked.
Author of Total Commander
http://www.ghisler.com

sweetbox
Junior Member
Junior Member
Posts: 29
Joined: 2012-03-27, 11:56 UTC

Re: (bug)total commander 3 beta 8 --- memory leak

Post by *sweetbox » 2019-09-27, 04:28 UTC

8.8KB to 526.2KB with resolution mostly 500X500,600X600
all small pictures( .jpg)

Post Reply