Hi there,
AWS lightsail and wordpress expert here, I will help you figure out the issue of out of memory.
There are many reason which cause this memory issues like some have files are opened by internal processes or took too much time in reading database queries or some plugins
If you could share some more details then i will come up with more sophisticated solution.
I am wordpress developer with experience of more then 8+ years . I have developed 100+ websites in wordpress from scratch out of the box i have developed custom functionality and developed and customize wordpress plugins over the time
I am confident , interested and would like to communicate further in details over chat
Thanks