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 https://github.com/JuliaData/Parsers.jl.git,
 error: GitError(Code:ERROR, Class:OS, failed to truncate pack file 
'/MYDIRECTORY/julia/julia_project/clones/69de0a69-1ddd-5017-9359-2bf0b02dc9f0/objects/pack/pack_git2_K7rjbU':
 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.