tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Memory leak in Tomcat 7?
Date Wed, 12 Jan 2011 22:36:42 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ilya,

On 1/12/2011 5:08 PM, ilya goberman wrote:
> public class WebFrameworkServletScriptStreaming extends HttpServlet {
> 
>     public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
>         response.setHeader("pragma", "no-cache,no-store");
>         response.setHeader("cache-control", "no-cache,no-store,max-age=0,max-stale=0");
>         
>         response.setContentType("text/json");
> 
>         PrintWriter out = response.getWriter();
>         
>         for (int i = 0; i < 1000; i++) {
>             out.print("push('{\"foo\":\"bar\"}');");
>         }
>     }
> }

Looks fairly benign.

> This is the client - use FF:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
> <html>
> <head>
>     <title>test</title>
> </head>
> <body">
>     <input type="button" value="TEST" onclick="test(); return false;" />
> 
>     <script type="text/javascript">
>         var id = 0;
> 
>         function test() {
>             var head = document.getElementsByTagName('head')[0];
>             var script = document.createElement('script');
>             script.type = 'text/javascript';
>             script.onreadystatechange = function () {
>             };
>             script.onload = function () {
>                 head.removeChild(script);
>                 // LOOP!!!
>                 test();
>             };
>             script.onerror = function () {
>                 head.removeChild(script);
>             };
>             script.src = 'http://172.16.16.250/Test/Controller?test=' + (id++);
>             head.appendChild(script);
>         }
> 
>         function push(json) {
>         }
>         
>     </script>
> 
> </body>
> </html>

I don't see where that client connects to any server.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0uLPkACgkQ9CaO5/Lv0PBsGgCgmmwocE9Aiu5dlUlpwpgSJMjH
6V8AoL7VBIJwyNRoglFqLSvZdEfShsrL
=lx9M
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message