Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rsync + malloc = Crazy Delicious



At 4:20 PM -0400 6/7/07, Douglas Back wrote:
I have a launchd job that runs a little shell bash script for some rsync backup action. I'm running 10.4.9 with the latest Security Update (and as far as I can tell, the extended attributes and ACLs that I need are being copied properly, so 2007-005 did seem to fix whatever 004 broke). The script backs up several AFP share points with a total of about 140GB of data (300,000 files or so). The share is hosted on an Xserve G5 with 2GB of RAM.

The job ran like a champ for about 3 days (it's set to run every few hours), and then last night it stopped running properly. It was exiting with code 22 (Error allocating core memory buffers). I added the verbose flag to the script this morning and ran it again in the terminal and about 85% of the way through this started popping up:

rsync(7321) malloc: *** vm_allocate(size=8421376) failed (error code=3)
rsync(7321) malloc: *** error: can't allocate region
rsync(7321) malloc: *** set a breakpoint in szone_error to debug

This continues for about a minute or so (seemingly continuing to copy files, but that's suspect) until finally the process crashed and this was spit out:

rsync(7563) malloc: *** vm_allocate(size=8421376) failed (error code=3)
rsync(7563) malloc: *** error: can't allocate region
rsync(7563) malloc: *** set a breakpoint in szone_error to debug
ERROR: out of memory in map_ptr
rsync error: error allocating core memory buffers (code 22) at /SourceCache/rsync/rsync-24.1/rsync/util.c(120)
rsync: writefd_unbuffered failed to write 105 bytes: phase "unknown" [generator]: Broken pipe (32)
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-24.1/rsync/io.c(909)


When this happens, rsync has allocated (according to Activity Monitor) 1.52GB of real memory, 1.89GB of virtual memory and the total VM is approaching but not quite at 8GB (7.91GB). It also happens near the same point, i.e. pretty consistently within the same folder, but with different files (I'm assuming because of changing memory use during each subsequent run).

So. Is this a VM limitation of the G5? Of the OS? A real memory limitation? Rsync bugginess that Apple needs to fix? If it is an OS limitation, is it one that can be removed by editing a config file?

It's a limit of having 32 bits. Do the math. (Actually OS X on 64 bit hw Tiger gives you more than this, but there is still currently a address space limit that you've hit.)


Use more suitable rsync command operations with more suitable size "chunk" requests.


Of course you probably don't want to be using rsync in general b/c it's such a lose.
--


-dhan

------------------------------------------------------------------------
Dan Shoop                                                   AIM: iWiring
Systems & Networks Architect                      http://www.ustsvs.com/
email@hidden                                http://www.iwiring.net/
1-714-363-1174
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden
References: 
 >rsync + malloc = Crazy Delicious (From: Douglas Back <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.