Hello VinothS,
The AOSP is supported by Google so I would suggest that you consult the Google Developer Forums.
It seems, however, that you need more RAM (or SWAP) memory for building Android. Please review the requirements from the Android Source repository:
https://source.android.com/setup/build/requirements
I hope this helps.
Regards,