AWS Task definition memory for Ubuntu docker image
There are two important parameters that you can use wisely to deal with AWS ECS task definition. 

memory: 


  The hard limit (in MiB) of memory to present to the container. If your
  container attempts to exceed the memory specified here, the container
  is killed.


memoryReservation: 


  Docker attempts to keep the container memory to this soft limit;
  however, your container can consume more memory when it needs to.


I recommend you to go with memoryReservation. So your task definition will look like this. 

{
  "family": "my-alpine",
  "networkMode": "bridge",
  "containerDefinitions": [
    {
      "image": "alpine:latest",
      "name": "my-alpine",
      "memoryReservation": 100,
      ...
      ...
    }
  ]
}