1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Winscp: out of memory error

Discussion in 'Tomato Firmware' started by Kingmob, Nov 27, 2009.

  1. Kingmob

    Kingmob Addicted to LI Member

    I want to access files on my home server from the internet. To tunnel things like VNC etc. i use the ssh daemon. This all works fine, but now I also want to transfer files from my network.
    I first looked into setting up an sFTP server, but I wasn't immediately succesfull.

    So now I have mounted a disk from the server on /cifs1 and then i tried connecting with scp. It works and i can navigate the folders. but when i start transfering files, I get disconnected after a short while. The tomato log tells me the following:
    Nov 27 16:19:02 WPN824 user.err kernel: Out of Memory: Killed process 781 (dropbear).

    Why is this and is there any way I can prevent it from happening. If not, will installing an sFTP server on the router solve it? I'd like to keep things as simple and secure as possible, so i would like to reduce the ways of connecting to the ssh method as much as possible.
     
  2. Kingmob

    Kingmob Addicted to LI Member

    *Bump*

    Noone?
     
  3. Planiwa

    Planiwa LI Guru Member

    It's not (the host running) Winscp that is out of memory ...

    Apparently you are unknowingly attempting to copy files to the router.
    Perhaps now that you know this, the error is obvious, when you think about it?

    Perhaps you could try to ...

    1. scp a small file from the router to your remote PC. try: /var/log/messages

    2. once that works, scp a small file from the local PC ( i.e. from /cifs1/ ).

    In each case, verify your results.

    If that still fails, you might consider posting the command line that you used.
     
  4. Kingmob

    Kingmob Addicted to LI Member

    Thank you for the reply. I had in the mean time already done what you suggested. Both work, but an additional test with a file slightly larger than the remaining free memory was also successful, so the file is not copied, but maybe (probably I guess) 'buffered'. Strangely enough, a file about twice this size still fails. Also, trying the same file (the one around my amount of memory) a second time, will fail, because after one transfer, my free memory will have dropped to 10%

    Once the transfer starts I see a big drop in Free memory in the router, but I still have 1.5% left or so. With a larger file, this drops below 1% and so the process is killed. Apparently the amount of memory reserved is dependent on file size? But that would be absurd in case of really large files?
     
  5. Planiwa

    Planiwa LI Guru Member

    In case anyone is seriously interested in how memory is affected by scp, here are memory measurements:

    Code:
    [SIZE="1"]091130_18:01:53     T:14476 F:944 B:1132 C:5060 A:4408 I:3528 BCAI:14128 U:13532 T-FBCAI:-596
    091130_18:02:08  10 T:14476 F:872 B:1132 C:5060 A:4408 I:3592 BCAI:14192 U:13604 T-FBCAI:-588
    091130_18:02:10     T:14476 F:800 B:1132 C:5108 A:4408 I:3664 BCAI:14312 U:13676 T-FBCAI:-636
    091130_18:02:13     T:14476 F:944 B:1132 C:5060 A:4408 I:3528 BCAI:14128 U:13532 T-FBCAI:-596
    091130_18:02:56  31 T:14476 F:940 B:1132 C:5060 A:4408 I:3528 BCAI:14128 U:13536 T-FBCAI:-592
    091130_18:04:09  53 T:14476 F:856 B:1132 C:5060 A:4408 I:3604 BCAI:14204 U:13620 T-FBCAI:-584
    091130_18:04:12     T:14476 F:940 B:1132 C:5060 A:4408 I:3528 BCAI:14128 U:13536 T-FBCAI:-592
    091130_18:06:08  87 T:14476 F:856 B:1132 C:5060 A:4408 I:3604 BCAI:14204 U:13620 T-FBCAI:-584
    091130_18:06:11     T:14476 F:940 B:1132 C:5060 A:4408 I:3528 BCAI:14128 U:13536 T-FBCAI:-592
    091130_18:06:45  24 T:14476 F:864 B:1132 C:5060 A:4408 I:3588 BCAI:14188 U:13612 T-FBCAI:-576
    091130_18:06:47     T:14476 F:784 B:1132 C:5060 A:4408 I:3664 BCAI:14264 U:13692 T-FBCAI:-572
    091130_18:06:49     T:14476 F:780 B:1132 C:5060 A:4408 I:3668 BCAI:14268 U:13696 T-FBCAI:-572
    091130_18:07:02   8 T:14476 F:776 B:1132 C:5060 A:4408 I:3676 BCAI:14276 U:13700 T-FBCAI:-576
    091130_18:[B]07:05[/B]     T:14476 F:276 B:1116 C:4212 A:5632 I:3140 BCAI:14100 U:14200 T-FBCAI:100
    091130_18:07:08     T:14476 F:172 B:804 C:3188 A:5432 I:3624 BCAI:13048 U:14304 T-FBCAI:1256
    091130_18:07:11     T:14476 F:372 B:404 C:2460 A:5168 I:3688 BCAI:11720 U:14104 T-FBCAI:2384
    091130_18:07:14     T:14476 F:272 B:376 C:2504 A:5592 I:3368 BCAI:11840 U:14204 T-FBCAI:2364
    091130_18:07:16     T:14476 F:272 B:376 C:2504 A:5588 I:3372 BCAI:11840 U:14204 T-FBCAI:2364
    091130_18:07:19     T:14476 F:264 B:376 C:2504 A:5588 I:3372 BCAI:11840 U:14212 T-FBCAI:2372
    091130_18:07:21     T:14476 F:256 B:376 C:2504 A:5624 I:3344 BCAI:11848 U:14220 T-FBCAI:2372
    091130_18:07:24     T:14476 F:380 B:332 C:2420 A:5520 I:3320 BCAI:11592 U:14096 T-FBCAI:2504
    091130_18:07:30   3 T:14476 F:384 B:332 C:2420 A:5520 I:3320 BCAI:11592 U:14092 T-FBCAI:2500
    091130_18:07:33     T:14476 F:372 B:332 C:2420 A:5520 I:3328 BCAI:11600 U:14104 T-FBCAI:2504
    091130_18:07:39   3 T:14476 F:376 B:332 C:2420 A:5520 I:3328 BCAI:11600 U:14100 T-FBCAI:2500
    091130_18:07:42     T:14476 F:368 B:332 C:2424 A:5520 I:3332 BCAI:11608 U:14108 T-FBCAI:2500
    091130_18:07:47   2 T:14476 F:372 B:332 C:2424 A:5520 I:3332 BCAI:11608 U:14104 T-FBCAI:2496
    091130_18:07:49     T:14476 F:368 B:332 C:2424 A:5520 I:3332 BCAI:11608 U:14108 T-FBCAI:2500
    091130_18:07:56   3 T:14476 F:372 B:332 C:2424 A:5524 I:3328 BCAI:11608 U:14104 T-FBCAI:2496
    091130_18:08:01   2 T:14476 F:372 B:332 C:2424 A:5536 I:3316 BCAI:11608 U:14104 T-FBCAI:2496
    091130_18:[B]08:03[/B]     T:14476 F:4580 B:404 C:2532 A:1852 I:2828 BCAI:7616 U:9896 T-FBCAI:2280
    091130_18:08:10   3 T:14476 F:4244 B:468 C:2716 A:1940 I:3064 BCAI:8188 U:10232 T-FBCAI:2044
    091130_18:08:12     T:14476 F:4100 B:500 C:2812 A:2004 I:3140 BCAI:8456 U:10376 T-FBCAI:1920
    091130_18:08:15     T:14476 F:4244 B:500 C:2764 A:1988 I:3020 BCAI:8272 U:10232 T-FBCAI:1960
    ..............................................[/SIZE]
    
    scp /proc/kcore starts at 07:05 and is interrupted at 08:03 after about 3.5 MB.

    The memory counts don't exactly add up.
    Note how F+C goes from 6MB before to 7MB after.
    Note how F drops frm 900k to 172k when the scp starts.
    Note how F jumps as high as 4580 when the scp is killed.
    Note how U drops from 14MB to 10 MB when scp is stopped.
    Note how BCAI drops from 14312 to 7616. That's almost 7MB.
     

Share This Page