Rsync hogs memory
I'm using rsync on my fileserver to backup the data. The problem is that rsync doesn't seem to release the memory it uses. After booting ~20 MB of memory is in use. This jumps up to 270 MB after running rsync. I know rsync uses quite a bit of memory when it's running, but surely it should be released upon completion.
Here's the situation after booting the system (free -m): Code:
total used free shared buffers cached Code:
total used free shared buffers cached |
Linux uses all the RAM it can find for active progs and caches. If a program exits, the RAM remains cached until another process needs it, at which pt the kernel will flush the old/unwanted stuff and re-use the RAM for the new proc.
The kernel handles all this transparently. IOW, ignore it, it's not an issue. |
I knew someone would say that ;) That's why I posted the output of the free command in the first place.
I know about Linux caching. However, if you take a look at the output of the free command above, you'll notice that 480 MB of total memory is in use and only 156 MB cached + 53 MB buffered (i.e. 209 MB), so I'm still missing the mentioned 270 MB (well, 271 MB actually, but that's a rounding error). It _is_ an issue because after a couple of rsyncs almost all the memory is used (disappeared, not cached+buffered) and the system becomes very unresponsive. |
Anyone?
|
Wow . . . well, if you really think that rsync is leaking or failing to free memory, then I would suggest building a fresh version from source or downloading another binary and seeing if it still happens. I know that rsync does not do this to me.
If it still happens, the problem may not be with rsync. Are we talking Slackware 13 here? |
Nope, it's not Slack 13, it's 11 (with all the available upgrades installed, though). So far I've seen no reason to upgrade it since 11 really does everything I want it to do. rsync is version 2.6.9 on this system. I'll try to build a newer one to see if that works better.
|
Quote:
Code:
[root@server] sync; echo 2 > /proc/sys/vm/drop_caches A note about rsync: it's recommended to have the same rsync version on both ends of the transfer for best performance and to avoid possible issues. And v. 3 brings some important changes -- have a look through the release notes. |
drop_caches doesn't work with 2.4 series kernel. I think I'll just compile a newer version of rsync and see how that goes.
|
Quote:
I'm running RHEL5.4 and am using rsync for backup onto a 2nd disk (something like poor man's RAID 1). This worked for me. Thanks! |
All times are GMT -5. The time now is 12:25 PM. |