Author Topic: high CPU usage  (Read 28865 times)

xian

  • Junior Member
  • **
  • Posts: 30
    • View Profile
high CPU usage
« on: April 07, 2014, 11:31:28 »
I experience occasional high CPU usage for no (obvious) reason on Win7 64bit with MC v4.1 (build 1620) 64 bit. The software still works but keeps 1 CPU core busy on a 2 core notebook (50% load). If I restart MC the problem goes away for a while.
I don't recall such issue with previous versions.
Is there anything I should check when I experience the problem? Thank you.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4411
    • View Profile
    • Multi Commander
Re: high CPU usage
« Reply #1 on: April 07, 2014, 12:21:58 »
The only background work that MC do is fetching file icons and file properties for extended columns (if you have any of them showing) and file coloring
However 3de party shell extension can also hook it self into MC and do stuff.

What you can do is to create a dumpfile when it is happening from task manager and then upload it to http://multicommander.com/upload and I might be able to see what it is doing

xian

  • Junior Member
  • **
  • Posts: 30
    • View Profile
Re: high CPU usage
« Reply #2 on: April 07, 2014, 13:48:32 »
I managed to reproduce the high load by connecting and disconnecting to an FTP site. I'm not sure if the issue is related, I have uploaded the dump (high load - MultiCommander.DMP).

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4411
    • View Profile
    • Multi Commander
Re: high CPU usage
« Reply #3 on: April 07, 2014, 18:00:06 »
According to the dump it is not doing anything, it is idle.
not processing icons, not processing extra file properties,

According to the dump there is no high cpu usage at the time the dump was created.

If it comes and goes, then maybe the dump was created just after it went away or something.

Is it only happening after disconnect from FTP ?  how do you disconnect ?. (pressing the disconnect button in the Explorer Panel ? )

xian

  • Junior Member
  • **
  • Posts: 30
    • View Profile
Re: high CPU usage
« Reply #4 on: April 08, 2014, 09:38:57 »
Yes, maybe I missed it. This was just discovered yesterday, that a high load was after FTP connection. I pressed the disconnect button, yes.

Earlier I just noticed my notebook air vents gone crazy and saw 50% (full core) load. I don't remember any specific activity before these occasions, happened a few times. I'll watch out and try to catch one of those.

Thanks

modisanyi

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: high CPU usage
« Reply #5 on: April 16, 2014, 10:53:01 »
Hi!
I have observed also high cpu usage when a MC pane is displaying a folder where another process is modifying a file - ex. Firefox is downloading a file; in this folder there are some 1500 files and about 100 subfolders. The high cpu usage continues until i change the displayed folder, or the download is finished.
I'm not sure that I can reproduce this every time, but I have observed this behavior many times.

Thanks.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4411
    • View Profile
    • Multi Commander
Re: high CPU usage
« Reply #6 on: April 16, 2014, 12:34:09 »
When files in a folder are changed Windows will notify MC about that. And MC will refresh the file or entire folder if needed. but normally entire folder is not needed. But A rescan should not use a lot of CPU, (Windows even cache it.)

I have no idea how it can use lots of CPU for you, because it can be many many different thing that causes it to be slow.
I'm not able to reproduce it, not even on my old slow machine.

You can try to disable things that are running in the background like not showing icons, not showing overlay icons, make sure you do not view in thumbnail mode. (since thumbnails are fetched in background) , Only show standard columns  (name,ext,size,date,attribute)
If there are a lot of .exe / .dll files in the folder the AntiVirus software might hook in the scan the file before the program can get the program icon.


ice-man

  • Active Member
  • ***
  • Posts: 56
  • The Little Extra
    • View Profile
Re: high CPU usage
« Reply #7 on: April 16, 2014, 15:27:58 »
If you enter "dbg fslog" into the command line field and restarts MC. It will activate a FileSystem browser log in the log panel (ctrl+L)
However it is a bit chatty and very technical. But you might get some hints from it.
(type it again to turn it off )


Intel i7-6700K - Running on latest Windows 10 64bit Insider Preview

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4411
    • View Profile
    • Multi Commander
Re: high CPU usage
« Reply #8 on: April 16, 2014, 15:47:54 »
Yes he can do that, And he might get some clues.
However, It is a debug output of internal works. I normally do not advice doing that, because it is a very very technical output and most people will not understand it and will then just copy and paste the log back into here.
And that will most of the time not give me much since that information alone does not say much, The log by it self  is a bit out of context, You often need the log together with other information and other logs.

modisanyi

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: high CPU usage
« Reply #9 on: April 16, 2014, 22:32:12 »
Thank you.
I will give it a try tomorrow, and come back hopefully with some results.

I don't say that is slow, it (MC) just eats up a full core from the cpu. It may be because of the av, but the cpu is eaten up by MC. Nor Windows Explorer, nor TotalCommander does experience this behavior.

Thanks for the "dbg fslog" hint, I'll try it - and not post back the log.

Btw, I'm using MC in commander style and displaying the standard columns.

modisanyi

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: high CPU usage
« Reply #10 on: April 17, 2014, 08:59:37 »
Hi, I'm back with good news.
I have tracked down the culprit.

I have TortoiseSVN installed, and the TSVNCache process was scanning the folder and causing the spike in cpu usage in MC.
When I excluded the folder from caching in TortoiseSVN, the cpu usage in MC stopped. Interesting, indeed.

But, as the original poster stated, there is - it seems - another issue with the FTP module.
Every time I open a FTP connection, MC will eat up 1 core, and even if I close the connection, the cpu usage will remain until I restart MC. This seems not to be related to TortoiseSVN or the AV(Comodo) as both of them were disabled.

I will try to reproduce the issue on a clean VM installation.

Processexplorer will show FSFTP.dll+0x27732 as the cpu hog, inside MC.

Sorry about hijacking this thread. I thought  that the two issues were related.

Thank you!

modisanyi

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: high CPU usage
« Reply #11 on: April 18, 2014, 11:31:26 »
Hi!

I have tested the FTP module cpu usage in a clean vm installation, and I was able to reproduce it every time I tried to connect to a remote ftp site - quick connect/saved session, anonymous user, passive mode. I have tested with 2 different sites, with same results.

Thanks!

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4411
    • View Profile
    • Multi Commander
Re: high CPU usage
« Reply #12 on: April 18, 2014, 12:24:48 »
I can't redo it..
how FTP act depends a lot of how closely the FTP Server follows the standard.  And the problem is that almost all ftp server do not follow the standard correct in some places.  So there often need to be workaround for some servers.

Do you have NOOP (AntiIdle) enabled when connecting  (that is the only own background work that FTP do) ?
Do you know what kind of FTP server you connecting to ?

modisanyi

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: high CPU usage
« Reply #13 on: April 23, 2014, 09:54:26 »
Sorry for the delay.
I'm not using the NOOP. I have just the "Use Passive Mode" checked, and not doing anything, just connecting to the server. After connecting, the cpu usage spikes, and will stay there even after disconnecting from the server. The only way to recover, is to close MC and start it again. The server software is - from its banner - Pure-FTPd [privsep] [TLS]

The ftp server is a public one, its address is ftp.astral.ro. Anonymous user and default port.
It could be, that the server configuration is weird in some way (I have tried another ftp server, which is not anonymous, and is behaving the same way. From its banner, it is FileZilla Server version 0.9.27 beta).

I have updated to MC v4.2 build 1672 but there is no change in this behaviour.

Thank you.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4411
    • View Profile
    • Multi Commander
Re: high CPU usage
« Reply #14 on: April 23, 2014, 10:10:53 »
Try to enable AntiIdle (NOOP), Might be that is starts anyway but without a connection.

modisanyi

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: high CPU usage
« Reply #15 on: April 23, 2014, 11:40:48 »
Bingo!
With NOOP enabled, there is no high cpu usage.
But IMHO, there is something fishy with the ftp module (why does the cpu usage remain  - checked with processexplorer - even if I disconnect from the server - with noop disabled? ).

Thank you!

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4411
    • View Profile
    • Multi Commander
Re: high CPU usage
« Reply #16 on: April 23, 2014, 12:19:12 »
You say that there is no high cpu usage with NOOP enabled and then that cpu usage remain.. ?
Was the CPU issue solved with enabled AntiIdle. ???

I think it is because of a timing issue. The antiIdle handling (background work) gets into a state where it tries to get a connection (to do NOOP on), but it does not finds one but it continues to try to find one. over and over and over again.. (Just what I suspect.. Have not had time to check the code yet)




modisanyi

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: high CPU usage
« Reply #17 on: April 23, 2014, 13:08:59 »
Sorry, I mixed them up a little bit.

The cpu usage is solved with NOOP checked.

What I wanted to say, is that when NOOP is NOT checked, and I connect then disconnect from the server, the cpu usage will remain until I restart MC. I expected that when I hit disconnect, the ftp module to shut down.

As you said, the problem is caused most likely by a timing issue.

Thank you for your help!

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4411
    • View Profile
    • Multi Commander
Re: high CPU usage
« Reply #18 on: April 23, 2014, 14:50:29 »
Great.

The AntiIdle thread is running in the background and since it got into a loop checking for a valid connection is think it does not close that thread.. That thread just continues..  I will fix that for the next version.