Cloning a project - out of memory error

I am trying to instantiate a Julia project environment in a virtual linux machine. I copy the relevant Project.toml, and the Pkg system sees it correctly. However, when I type instantiate I keep getting the errors similar to the one quoted below indicating that it cannot allocate memory.
The virtual machine has 8Gb RAM and nothing else is running so that the system monitor indicates less than 1GB is in use. It doesn’t seem like the system would need 7GB RAM to install a few relatively small package files - any idea what might be going on?

ERROR: failed to clone from,
 error: GitError(Code:ERROR, Class:OS, failed to truncate pack file 
 Cannot allocate memory)

I just tried the same process on a VM with more memory, and it does in fact proceed without problems.

I am very surprised that it takes so much memory to just install packages. I would still appreciate further insights into why this is so, or if there is any workaround.