What is the (memory) trace of the Java EE servlet?

For Jetty, Tomcat, or any other servlet container of your choice, what is the average size (memory and any other notable resources) of the underlying servlet? This includes any other underlying objects that you almost always need for each servlet, for example, a view recognizer.

I am not looking for a quantitative number, in particular, but any approximate answer that could give an idea of ​​how a "heavy" or "light" servlet is.

+4
source share
2 answers

I don’t think this is what brings you much benefit from the Stack Overflow query. The variability in defining the “base” and various servlet software versions will be much greater than the amount of effort required to verify this yourself.

Just create a "hello world" type servlet that has no fields, start your servlet container with this WAR and measure your memory usage. This will generally give you the overhead of the servlet container, which you can then subtract from your actual memory measurements when you see how “heavy” the target servlet is.

The numbers will be much more useful if you create yourself using the actual target version of the servlet container in the real system in question, than someone answering here saying "47MB" or the like.

+4
source

The size of the container is pretty out of place (Tomcat or Jetty, not Websphere or something like that) if you are not doing inline programming. The servlet size can be as small as you need, or as large as you need. Generally speaking, idle web applications will have less thread overhead than stateful.

0
source

Source: https://habr.com/ru/post/1310014/


All Articles