-
Notifications
You must be signed in to change notification settings - Fork 109
Memory
Agit should be reporting this better - but the hang is due to an OutOfMemoryError occuring in the underlying JGit library, caused by a 19MB textfile in the repository you're trying to clone:
Mobile devices don't have as much memory as desktop computers, and on an Android device the amount of memory available to app processes is relatively low (even a Nexus 7 tablet only makes around 64MB available). Although the underlying JGit library used by Agit does it's best to stream large files and not hold them all in-memory at one time, the way Git stores and transmits files in packfiles can cause memory consumption to behave in unpredictable ways.
For example, see this repo with a large file:
Large objects are streamed wherever possible and consequently files of this size often won't cause problems, even on a relatively memory constrained device like an Android. That works so long as the large object is stored as a whole object within the Git packfile. However, if the file is similar to any other file stored anywhere within the repositories history, they can both be stored in delta format - which unfortunately requires a full in-memory representation to decompress - and the Android device blows up with an OutOfMemoryError.
The above commit in the p2p-adb repository is a change to the gesture_hash.txt file, which will have pushed it into delta representation and made it almost impossible to decompress on a low-memory device.
This is why I wince whenever I see people checking large files into source control - personally I wouldn't include any file over ~2 MB in size... given it's a generated file, I would have just included the generating script in the repo, along with possibly a checksum for the generated file - and let people get the hashfile by web download if they want to.
- Features
- SSH & HTTP support
- Bare-Repos & Finding-Your-Files
- Memory usage
- Reporting-Bugs
- Contributing