incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From monte...@apache.org
Subject svn commit: r776651 - /incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/OOM.jsp
Date Wed, 20 May 2009 10:23:12 GMT
Author: monteith
Date: Wed May 20 10:23:12 2009
New Revision: 776651

URL: http://svn.apache.org/viewvc?rev=776651&view=rev
Log:
Add "OOM.jsp" that causes OutOfMemoryErrors - uses a static and an instance variable to OOM
using a HashMap.

Added:
    incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/OOM.jsp   (with props)

Added: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/OOM.jsp
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/OOM.jsp?rev=776651&view=auto
==============================================================================
--- incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/OOM.jsp (added)
+++ incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/OOM.jsp Wed May 20 10:23:12
2009
@@ -0,0 +1,80 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+    pageEncoding="ISO-8859-1"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- 
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.    
+ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Out Of Memory</title>
+</head>
+<body>
+<h1><blink><font color="Red">WARNING!</font></blink></h1>
+Pressing the following button may kill your server, and will definitely cause it to 
+dump! Press once!
+<pre>
+JVM:
+<%
+	out.write(System.getProperty("java.vm.vendor")+", "+
+			System.getProperty("java.vm.name")+", "+			
+			System.getProperty("java.vm.version"));
+%>
+</pre>
+
+<form name="OOM" method="post" action="">
+<input type="submit" value="OOM" name="DoOOM"/>
+<input type="submit" value="StaticOOM" name="DoOOM"/>
+
+</form>
+<%@page import="java.util.HashMap" %>
+<%! static HashMap staticmap;
+	HashMap map;
+%>
+<%
+	String dumpType = request.getParameter("DoOOM");
+
+	if( "OOM".equals(dumpType)) {		
+		out.write("OOming "+System.getProperty("user.dir"));
+		out.flush();
+		
+		// HashMaps often cause problems.
+		map = new HashMap();
+		
+		long value = 0;
+		while (true) {
+			map.put(value, new byte[1048576]);
+			value++;
+		}
+	} else if( "StaticOOM".equals(dumpType)) {
+		out.write("Static OOming "+System.getProperty("user.dir"));
+		out.flush();
+		
+		// HashMaps often cause problems.
+
+		staticmap = new HashMap();
+		long value = 0;
+		while (true) {
+			staticmap.put(value, new byte[1048576]);
+			value++;
+		}
+	
+	}
+%>
+</body>
+</html>
\ No newline at end of file

Propchange: incubator/kato/trunk/org.apache.kato.example.tomcat/WebContent/OOM.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message