Uploading large csv files to aggregate

What is the problem? Please be detailed.
Hello I'm running out of memory when I try to upload large files.
Sorry I'm asking this again, I followed Yaw suggestion about using the Formuploader and it worked.
In fact it was still working last month but after the recent events in Mexico I had to stop my project till last week and when I tried to upload again the same form it failed. The formuploader fails and tomcat exits.

What ODK tool and version are you using? And on what device and operating system version?
Aggregate v.1.4.15
Formuploader v.1.4.9
aws t2.micro ec2 instance
tomcat8
debian stretch
postgresql 9.6.4

What steps can we take to reproduce the problem?
Tomcat always exits after formuploader fails to upload the files

What you have you tried to fix the problem?
I added Xms512m and Xmx512m and maxPostSize=-1 but still doesn't work

Anything else we should know or have? If you have a test form or screenshots or logs, attach here.

The tomcat log says:

SEVERE: Form upload persistence error: org.opendatakit.common.persistence.exception.ODKEntityPersistException: org.springframework.dao.DataAccessResourceFailureException: PreparedStatementCallback; SQL [INSERT INTO "odk_prod"."_form_info_manifest_blb" ( "_URI", "_CREATOR_URI_USER", "_CREATION_DATE", "_LAST_UPDATE_URI_USER", "_LAST_UPDATE_DATE", "_TOP_LEVEL_AURI", "VALUE" ) VALUES ( ?, ?, ?, ?, ?, ?, ? ) ]; ERROR: out of memory
Detail: Failed on request of size 67108864.; nested exception is org.postgresql.util.PSQLException: ERROR: out of memory
Detail: Failed on request of size 67108864.
org.opendatakit.common.persistence.exception.ODKEntityPersistException: org.springframework.dao.DataAccessResourceFailureException: PreparedStatementCallback; SQL [INSERT INTO "odk_prod"."_form_info_manifest_blb" ( "_URI", "_CREATOR_URI_USER", "_CREATION_DATE", "_LAST_UPDATE_URI_USER", "_LAST_UPDATE_DATE", "_TOP_LEVEL_AURI", "VALUE" ) VALUES ( ?, ?, ?, ?, ?, ?, ? ) ]; ERROR: out of memory
Detail: Failed on request of size 67108864.; nested exception is org.postgresql.util.PSQLException: ERROR: out of memory
Detail: Failed on request of size 67108864.

This is the heap memory, the first two are using the formuploader and the last is from aggregate

Here are my files: https://drive.google.com/drive/folders/0ByT05oAp7x21QV9aWnlDemFGNDQ?usp=sharing

Thanks

512MB for Tomcat is not a lot of memory. For EC2 instances, I usually use t2.mediums with 90% of total RAM split 50/40 heap/non-heap. Something like -Xmx1843m -XX:PermSize=1475m -XX:MaxPermSize=1475m is a good start.

That said, it seems the problem has to do with PostgreSQL running out of memory because 67108864 bytes is 64 MB. I don't know where in PostgreSQL to tweak this setting. Maybe shared_buffer?