RFR(S) 8189688: NMT: Report per-class load metadata information

Andrew Dinn adinn at redhat.com
Mon Oct 23 15:29:19 UTC 2017


On 23/10/17 16:03, Thomas Stüfe wrote:
> I am confused about the sizes though . Are we talking about the chunk
> sizes in metaspace.cpp? Because they are way smaller, with medium chunks
> being 32/64K? Or are these large chunks a RedHat addition?
Oops, apologies -- wrong units!

Yes, this is indeed chunk sizes but I meant to say 1KB and 4KB chunks
(MBs would be truly dreadful :-). The relevant definitions in
metaspace.cpp are:

enum ChunkSizes {    // in words.
  ClassSpecializedChunk = 128,
  SpecializedChunk = 128,
  ClassSmallChunk = 256,
  SmallChunk = 512,
  ClassMediumChunk = 4 * K,
  MediumChunk = 8 * K
};

Anonymous classes (used for the anon classes used to back lambdas)
initially allocate a ClassSpecializedChunk and a SpecializedChunk i.e. 2
x 128 * 8 bytes = 2 x 1KB. If you have something that goes beyond the
most basic lambda then you may well also allocate an extra SmallChunk =
512 * 8 bytes = 4KB. We experimented (with both real and synthetic
examples) and found a high proportion of cases where 6KB chunks was
being allocated but around 50% was left unused as free tail ends of
these 2/3 chunks.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the hotspot-runtime-dev mailing list