ftpserver icon indicating copy to clipboard operation
ftpserver copied to clipboard

Process uses 1GB of memory

Open josegonzalez opened this issue 9 months ago • 1 comments

One of the notes in the readme says it has a small memory footprint, but it appears to be using 1GB of ram?

 3702 root     1220m S    ftpserver -conf /mnt/SDCARD/.userdata/tg5040/FTP Server/ftpserver.json

The config is the following:

{
    "version": 1,
    "accesses": [
        {
            "user": "minui",
            "pass": "minui",
            "fs": "os",
            "params": {
                "basePath": ""
            }
        }
    ],
    "listen_address": "0.0.0.0:21",
    "logging": {
        "file_accesses": true,
        "ftp_exchanges": true
    },
    "passive_transfer_port_range": {
        "start": 2122,
        "end": 2130
    }
}

I'm running the arm64 version on the Trimui Brick handheld device. Any ideas as to what might be causing the large ram usage?

josegonzalez avatar Apr 29 '25 19:04 josegonzalez

@josegonzalez

Hi, I'm not a maintainer of this project, but I recently ran into a similar issue in a different context and got an explanation that made sense to me. I thought it might be helpful to share here in case it’s relevant to your situation too.

I'm also using a Linux system with an arm64 CPU. When I ran ftpserver and checked the process using ps -u -p , I saw the VSZ value was over 1GB—just like you observed. To dig a bit deeper, I wrote a simple "hello world" program that just prints a message and then sleeps for an hour. Surprisingly, it also showed a VSZ over 1GB.

This seems to suggest the high VSZ isn’t specific to ftpserver, but more likely related to how Go allocates virtual memory. From what I’ve learned, it’s not something to worry about. The Go team explains this behavior here:

https://go.dev/doc/faq#Why_does_my_Go_process_use_so_much_virtual_memory

So even though it looks like ftpserver is using over 1GB of memory, the actual memory usage is likely much lower. You might want to look at the RSS value instead—although even that isn’t a perfect measure, it can give you a rough idea.

Hope this helps!

bamchoh avatar Jun 06 '25 15:06 bamchoh

Yes definitely not related to ftpserver. On Mac Os you can even read 392GB of virtual memory size.

Image

fclairamb avatar Aug 29 '25 22:08 fclairamb