Class MemoryUsageServlet
- java.lang.Object
-
- jakarta.servlet.GenericServlet
-
- jakarta.servlet.http.HttpServlet
-
- org.jboss.test.clusterbench.web.load.MemoryUsageServlet
-
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
@WebServlet(name="MemoryUsageServlet", urlPatterns="/memoryusage") public class MemoryUsageServlet extends jakarta.servlet.http.HttpServletMemoryUsageStress- Author:
- Michal Babacek This simple servlet is used for stressing memory. The objective is to force JVM to allocate a given amount of memory (in megabytes). After the memory is filled up, we wait for a specified number of milliseconds before dereferencing. E.g.: http://localhost:8080/clusterbench/memoryusage?milliseconds=20000&megabytes=500 will allocate 500MB and keep them for 20000ms. Warning: Obviously, if you set megabytes=1000 while having -Xmx512m you will experience an unpleasant and utterly inevitable OOM. Note: Naturally, if -Xms < -Xmx, JVM will be allocating more system physical memory. You can observe system physical memory values in the message you shall get from this servlet.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MemoryUsageServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)StringgetServletInfo()-
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service, service
-
-
-
-
Method Detail
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException- Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
getServletInfo
public String getServletInfo()
- Specified by:
getServletInfoin interfacejakarta.servlet.Servlet- Overrides:
getServletInfoin classjakarta.servlet.GenericServlet
-
-