You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2023/01/06 20:38:00 UTC

Any graalvm diet planned?

Hi all,

It is quite easy to make tomcat running with graalvm these days even
without any tooling (it is mainly about enabling one reflection point [1]
and a few bundles [2]) however the outcoming binary is quite fat compared
to what I expected (~40M).

Checking with graalvm dashboard (-H:DashboardDump=g.dump -H:+DashboardAll)
I realized it is mainly about constants - the code itself is about 18M,
heap 23M).
One surprising thing is that the heap references
mbeanserver.ClassLoaderRepository even disabling JMX - probably because
even when disabled classes still references it.

So I wonder if there is any plan for Tomcat 11 to make it more modular and
enable to reduce all that to try to get back to a ~15M binary (for a hello
world servlet so only tomcat).
Guess it can only target Nio connector, drop JMX from the main codepath
(make it a plugin) and probably drop some start-only constant from the
constant pool.

I'm not sure the best way to do that for the project but think it can
benefit native-image users a lot and even java consumers since at the end
the project can be lighter to integrate in embedded mode since most of the
XML stuff is less and less set up.


[1] [{"name" : "org.apache.coyote.AbstractProtocol", "allPublicMethods" :
true}]
[2] {

  "resources": {
    "includes": [
      {"pattern": ".+\\/LocalStrings\\.properties"},
      {"pattern":
"org\\/apache\\/catalina\\/core\\/RestrictedServlets\\.properties"},
      {"pattern":
"org\\/apache\\/catalina\\/core\\/RestrictedFilters\\.properties"},
      {"pattern":
"org\\/apache\\/catalina\\/core\\/RestrictedListeners\\.properties"},
      {"pattern": "org\\/apache\\/catalina\\/util\\/ServerInfo\\.properties"}
    ]
  }
}


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>