Many times i was facing problem of Out of Memory error for Tomcat while developing applications.
Sometimes IDE failed to stop tomcat. And if you try to start tomcat again on same port, you get error that "port is already in use". In such cases, below are steps to release Tomcat port to restart tomcat again on same port.
1. Find out which process is using Port using command
sudo netstat -lpn |grep :8080
You will get output like
tcp6 0 0 :::8080 :::* LISTEN 6749/java
2. Process Id 6749 is using port 8080.
3. Kill the process using command
kill 6749
Now you can again use port 8080 to run tomcat on this port.