My Drupal site has 22000 users, every time I tried the sync it always stoped after about 2000.
Initially I thought it was because of memory, but now I've found the reason in a little bug!
Drupal allows user to have special chars like "&" in their usernames. While importing, Gallery truncate such usernames at that chars and returns an error.

A friend of mine (I'm not good in PHP) has temporarily disabled the "normalization" function of Gallery2, then run the sync, then re-enabled it... All the 22000 users have been synchronised correctly: no errors any more, no memory problems!

Of course in using the latest version of Drupal6 and Gallery2.