Thoughts on Java metaspace allocation in IdP 4

Wessel, Keith kwessel at
Tue Jan 19 23:02:44 UTC 2021

Thanks, Scott and Simon. This helps a lot.


-----Original Message-----
From: users <users-bounces at> On Behalf Of Simon Lundström
Sent: Monday, January 18, 2021 2:59 AM
To: Shib Users <users at>
Subject: Re: Thoughts on Java metaspace allocation in IdP 4

On Sat, 2021-01-16 at 00:08:55 +0100, Wessel, Keith wrote:
>Hi, all,
>In reading up on Java's move from perm space to metaspace, I'm learning that it's advisable in many cases to limit Java's amount of memory used for metaspace with something like:
>-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=1024m
>Those numbers are probably too large for Shibboleth, I'm guessing. But if not set, it sounds like the metaspace can be as large as Tomcat or Jetty let it be.
>The wiki doesn't seem to offer any advice on these settings. Are there recommended values? Or can I assume that the IdP's use of metaspace and Java's garbage collection with - XX:+UseG1GC are good enough?

I've never had reason to change them either. It's usually very large 
apps which keeps a lot of compiled classes IIRC. And apps that load and 
unload a lot of classes?;!!DZ3fjg!qoUqANAqP3_Rqy-QiGrg4IG6ATw-LO2IFHjNmcMZhQdAFP1vXC-Pfqgf23BmK2eM6g$ 

Anyway, when in doubt measure it! As a one off use jconsole/jvisualvm 
and for continuous production usage use a JMX exporter to export the 
metrics to your metricsplatform. We use jmxtrans-agent[1] on all our 
IDPs and most of our other Java apps and we love it.

In JConsole I'm pretty sure that metaspace is the "Non-Heap Memory 
Usage" under the "Memory" tab. And in JMX the MBean would be 

- Simon

1, <;!!DZ3fjg!qoUqANAqP3_Rqy-QiGrg4IG6ATw-LO2IFHjNmcMZhQdAFP1vXC-Pfqgf23BxqBiXng$ >


Simon Lundström
Acting Technical Manager Identity management

IT Services
Stockholm University
SE-106 91 Stockholm, Sweden;!!DZ3fjg!qoUqANAqP3_Rqy-QiGrg4IG6ATw-LO2IFHjNmcMZhQdAFP1vXC-Pfqgf23BqPjZKkQ$;!!DZ3fjg!qoUqANAqP3_Rqy-QiGrg4IG6ATw-LO2IFHjNmcMZhQdAFP1vXC-Pfqgf23CHh0qmAw$ 
For Consortium Member technical support, see;!!DZ3fjg!qoUqANAqP3_Rqy-QiGrg4IG6ATw-LO2IFHjNmcMZhQdAFP1vXC-Pfqgf23Asm4yHVA$ 
To unsubscribe from this list send an email to users-unsubscribe at

More information about the users mailing list