There are lots of questions that ask this or a similar question.
They all give the command that has to be executed, what I don\'t understand is where do I write this
you can set this in catalina.sh as CATALINA_OPTS=-Xms512m -Xmx512m
Open your tomcat-dir/bin/catalina.sh file and add following line anywhere -
CATALINA_OPTS="$CATALINA_OPTS -Xms1024m -Xmx3024m"
and restart your tomcat