Unable to allocate requested memory in mega_alloc

I am running Q-chem on Amazon EC2. I am trying to optimize the geometry, calculate the energy of excited states and the vibrational frequencies of naphtalene using TDDFT + 6-311G* basis-set.
I have always this type of error:
I have Unable to allocate requested memory in mega_alloc. Please increase MEM_STATIC (current value: 400).
Do you have any suggestion how to estimate the MEM_STATIC?
Thank you in advance

The memory requirement is discussed in the Q-Chem manual under the topic of “solving the CPSCF equations in segments”. Solving the CPSCF equations in segments is a way to save memory, albeit at the expense of longer CPU time because integrals are recalculated for each segment.

Note that the units for MEM_STATIC are Mb, so 400 Mb is not very large. Use segments only if you are unable to increase the memory.