We had to extract text out of documents that people were uploading to the site so we can index them. As this was going to be just a text extraction services I didnt wanted to go for some full blown tomcat server so wrote a quick http server using java this.httpServer = HttpServer.create(addr, 0); HttpContext context = this.httpServer.createContext("/", new DocumentProcessHandler()); this.httpThreadPool = Executors.newFixedThreadPool(this.noOfThreads); this.httpServer.setExecutor(this.httpThreadPool); context.getFilters().add(new HttpParameterFilter()); this.httpServer.start(); Not adding all code for brevity. After being live for 2-3 days the process started crashing and it was a regular pattern. I added -verbose:gc -XX:+HeapDumpOnOutOfMemoryError ...