I have checked a few questions around this area. It seems malloc fail for insufficient memory is a common issue for massive files, and there are some work-arounds.
But my repository size (containing a readme, a few shell scripts, python scripts and config files, all texts), as reported by GitLab is 19.4 MB. When I run
git clone https://gitlab.com/username/project.git
the terminal echoes
fatal: Out of memory, malloc failed (tried to allocate 1744830464 bytes)
which is about 1.5GB. Where do these things come from? Not only I need a work-arounds, but I am also curious whether there is any hidden content in my repository which interferes with a smooth cloning. Also, so far it is a pretty fresh project and I only have one branch.
Using git version 2.19.0.windows.1 on windows 7
But the error does not show up on Linux staging clusters or even in Linux laptops using same configuration. From some further research, it seems the error might have something to do with editing file permissions on my Linux copy, and setting core.filemode to true. I did it because I do have to frequently alter the permissions of files in the production server and wanted these changes to be reflected in the repository.