It sounds like you are new to AE and don't understand how Ram Preview works. Your system only has half the Ram recommended in the Minimum System Requirements for the latest versions of AE.
You are going to have to learn how to use the options in the Preview Panel and the options for Comp Resolution to get longer ram previews. I always recommend setting comp resolution to Auto and your Magnification ratio to 50% or less if you need longer ram previews. After Effects is not a video editing app, it is not intended to be used as one, and the rendering and previewing of video is a completely different process than an editing app like Premiere Pro.
Spend some time with the User Guide and just use AE to create shots and short sequences that you can't create in an editing app, then cut your final project with your NLE.