RFR: 8170812: Metaspace corruption caused by incorrect memory size for MethodCounters

Thomas Stüfe thomas.stuefe at gmail.com
Thu Apr 6 10:35:09 UTC 2017

On Thu, Apr 6, 2017 at 11:09 AM, Andrew Haley <aph at redhat.com> wrote:

> On 06/04/17 10:05, Thomas Stüfe wrote:
> >
> > Don't the other childs of MetaspaceObj (e.g. Annotations, ConstMethod,
> MethodCounters) have the same problem?
> Possibly.  If anyone thinks I should fix them all, I will.
I think it would make sense. From what I can see, the following methods are


Worst thing the alignment is a noop because the class sizes are already
multiples of MetaWord.

Curiously, there is a function named "align_metadata_size" which gets
called in many cases but does not really do much:

inline intptr_t align_metadata_size(intptr_t size) {
  return align_size_up(size, 1);


> Andrew.

More information about the hotspot-dev mailing list