code: public static void destroyServlet()
      {
          Utility.getLogger().info("ServletTask destroy()");
  //+     if (m_application != null)
          {   // Never
  //+         m_application.removeTask(this);
  //+         m_application = null; // Do not free the application... the HttpSession will
          }
          Environment env = null;
  //+     if (m_application != null)
  //+         env = m_application.getEnvironment();
          if (env == null)
              env = Environment.getEnvironment(null);   // Make sure environment is inited
          // If all the applications are free (except for the MainApplication), free the environment.
          Utility.getLogger().info("App count " + env.getApplicationCount());
  //+        env.free();     // Done with environment if there are no more apps
      }
docs: Destroy this Servlet and any active applications.
  This is only called when all users are done using this Servlet.