1 Reply Latest reply on Jul 17, 2009 10:56 AM by peterj

    Out of memory exception in implementing  HttpEventServlet

      Hi,
      I have written a servlet which implements HttpEventServlet in Jboss 5.0, here is my event method.

      public void event(HttpEvent event) throws IOException, ServletException {
      HttpServletRequest request = event.getHttpServletRequest();
      HttpServletResponse response = event.getHttpServletResponse();
      System.out.println("Event Triggered .. " + event.getType());
      switch (event.getType()) {
      case BEGIN: {
      try {
      PrintWriter pr = response .getWriter();
      pr.write("Okie");
      pr.flush();
      pr.close()
      event.close();
      } catch(Exception e){
      e.printStackTrace();
      } finally {
      }
      break;
      }
      case EVENT:
      event.close();
      break;
      case ERROR:
      case EOF:
      case END:
      case TIMEOUT: {
      event.close();
      break;
      }

      }
      }


      When run a performance test for this servlet i am getting OutofmemoryError. can any one tried implementing HttpEventServlet in Jboss 5.0 ?

        • 1. Re: Out of memory exception in implementing  HttpEventServle
          peterj

          How do you know that the out-of-memory error has anything to do with this servlet? There are several different reasons for out-of-memory errors and all of their causes (and solutions) are different. Would you care to share the exact exception the JVM is giving?

          Also, you obvious knew that you can enclose your code within tags, so why did you use 'i' instead of 'code'?