#65 Too high CPU usage when copying files

closed-fixed
PCMan
None
5
2010-01-20
2006-11-20
Anonymous
No

I tried copying some big (about 300 Mb) files in PCmanFM, and it used about 40-50% CPU during the whole process. Nautilus, on the other hand, used no more than 2-3%.

Discussion

  • PCMan
    PCMan
    2006-11-22

    Logged In: YES
    user_id=1110932
    Originator: NO

    I think when you use nautilus, most of the work is done in gnome-vfs, a separate deamon process, not nautilus itself. You should check if there is any program having increased CPU usage when you copy files in nautilus.
    But I should admit that file handling parts of pcmanfm are not well-written. This should be improved in the future.

     
  • Rodolfo Borges
    Rodolfo Borges
    2008-02-15

    Logged In: YES
    user_id=311242
    Originator: NO

    _to copy a file_ is a basic system function, so it should not be done in program that manages files, but provided by the operating system.

    maybe `/bin/cp --report-to-stdout` could output info that a front-end program can use to display a progress dialog, or cancel the operation simply by closing the pipe.

    ok, this has nothing to do with pcmanfm, sorry.
    this had this idea now, and the "add a comment" was right in front of me :)

     
  • PCMan
    PCMan
    2008-02-16

    Logged In: YES
    user_id=1110932
    Originator: NO

    Well,
    I've no idea what happens.
    However, creating a front-end for cp is impossible.`
    That's my original idea, but in that way you cannot show progress...
    cp doesn't report the "percentage" even in verbose mode.
    So what we can do is writing everything *from scratch*.
    That is a pain....

     
  • Logged In: NO

    Here, fam is process which is using CPU that much during copy.

     
  • Logged In: YES
    user_id=2156363
    Originator: NO

    Yesterday I copied several Gigabytes from an external HDD to my home partition with pcmanfm and i can confirm that while pcmanfm was copying the files, i couldn't do anything else, than wait, because of the CPU usage.
    I used the latest 0.5 Version

     
  • Logged In: NO

    To solve this we can use front-end for cp, forexample:

    #!/bin/sh
    cp_p()
    {
    set -e
    strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ | awk '{
    count += $NF
    if (count % 10 == 0) {
    percent = count / total_size * 100
    printf "%3d%% [", percent
    for (i=0;i<=percent;i++)
    printf "="
    printf ">"
    for (i=percent;i<100;i++)
    printf " "
    printf "]\r"
    }
    }
    END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
    }

     
  • PCMan
    PCMan
    2010-01-20

    • assigned_to: nobody --> pcmanx
    • status: open --> closed-fixed
     
  • PCMan
    PCMan
    2010-01-20

    The latest pcmanfm built on top of glib/gio doesn't have this problem. Please test the latest source code in git repository.