ASF Bugzilla – Attachment 12639 Details for
Bug 20758
Memory Leak in Classloader/Manager deploy/undeploy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Revised Singleton Servlet.
SingletonServlet.java (text/plain), 1.44 KB, created by
Steve Menke
on 2004-09-03 16:28:21 UTC
(
hide
)
Description:
Revised Singleton Servlet.
Filename:
MIME Type:
Creator:
Steve Menke
Created:
2004-09-03 16:28:21 UTC
Size:
1.44 KB
patch
obsolete
>import javax.servlet.ServletException; >import javax.servlet.http.HttpServlet; >import javax.servlet.http.HttpServletRequest; >import javax.servlet.http.HttpServletResponse; >import java.io.File; >import java.io.IOException; >import java.io.OutputStream; >import java.io.PrintStream; >import java.lang.reflect.InvocationTargetException; > >import javax.servlet.ServletConfig; > >public class SingletonServlet extends HttpServlet { > private static BigSingleton bigSingleton; > > public void init(ServletConfig config) throws ServletException { > super.init(); > bigSingleton = BigSingleton.getInstance(); > } > > protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { > handleResponse(request, response); > } > > protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { > handleResponse(request, response); > } > > protected void handleResponse(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { > StringBuffer buf = new StringBuffer(); > buf.append("<html><body>"); > buf.append("Total Memory = " + Runtime.getRuntime().totalMemory()); > buf.append("</body></html>"); > OutputStream out = response.getOutputStream(); > PrintStream ps = new PrintStream(out); > ps.print(buf.toString()); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 20758
:
12622
|
12623
|
12624
|
12638
| 12639