build failure because of insufficient memory for the JRE

Am trying to build a ref app module but whenever i run it the test show me that there is insufficient memory for the JRE to continue some how confusing . Do i need to allocate memory specifically for the JRE?help me out

Java HotSpot™ Server VM warning: INFO: os::commit_memory(0x8db40000, 35913728, 0) failed; error=‘Cannot allocate memory’ (errno=12)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 35913728 bytes for committing reserved memory.

An error report file with more information is saved as:

/home/zac/basicexample/hs_err_pid4269.log

[ timer expired, abort… ]

Aborted (core dumped)

Can you see if this helps?

thanks alot swathivarkala!! creating the swap file helped me in better allocation for the RAM so i had no problems installing my ref app. thanks