If you have created a virtual machine for G2 testing with a very small memory allocation or are trying to run G2 on a physical machine with a low memory allocation or where G2 is competing for resources, it is possible you will encounter the following error:
This is one of the first memory intensive operations when starting G2, it indicates the G2 process is unable to acquire the memory it needs from the OS; the OS has exhausted available physical and virtual memory. Typically this occurs on a system with a small amount of physical memory (<2GB) and a small swap space (<1GB).
For a basic test virtual machine 4GB of physical RAM allocation should be considered the minimum to allocate.
Please also review the suggested minimum requirements here.
If you are seeing a "killed" message check out Why was G2Loader killed on Linux?