0

I have several .war sharing about 80% of common dependencies. I noticed that, when booting up the jboss (I'm using wildfly 12), the above error arises if the .war number goes up to 4 and more.

I think it's because each .war individually loads a lot of classes so, what would happen if I created a module containing the common .jars? Due to the isolation nothing would do or, maybe, the individual classloaders would take the common dependencies from the jboss classloader thus solving my problem?

I don't think raising the default MaxMetaspace JVM parameter would fix this problem, at the best it would delay it as I'm expecting the number of .war growing up steadily in the time and, from my understing of the metaspace, this space is not garbage collected like the heap, right?

Phate
  • 6,066
  • 15
  • 73
  • 138
  • Adding more wars requires more resources from everything, so saying "increasing metaspace will only delay this problem" doesn't make much sense. Your server doesn't support infinite wars in any case, regardless of the metaspace. Metaspace is also GC'd, but if there's nothing to collect that doesn't help much. I'm not saying you *shouldn't* create a shared module, I'm saying that it's not the last and only choice as your question makes it seem. – Kayaman May 27 '18 at 06:47
  • Doesn’t meta space contain static objects and stuff like old permegen? How can it be garbage collected ? Anyway the question is whatever sharing the common libraries will help or have no benefit at all except for the size of the .wars. – Phate May 27 '18 at 07:39
  • If you want to know the specifics of metaspace gc, you're free to do your own research. Increasing metaspace would be my first approach, as it's the least effort and guaranteed results. When that path is exhausted, I'd consider alternatives. But do what you want, just get your facts straight first. Someone who says "metaspace isn't gc'd" isn't qualified to configure memory settings at all. – Kayaman May 27 '18 at 07:44

0 Answers0