Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of heap memory addresses in GC logs using -XX:+PrintHeapAtGC?

The Java heap is divided into regions known as generations, e.g. new generation, which may be further divided, e.g. eden space. Using the -XX:+PrintHeapAtGC JVM option, three memory addresses for each heap region are printed in the GC logs in the form [A, B, C), where A, B and C are memory addresses, e.g.:

eden space 838912K, 100% used [0x000000073ae00000, 0x000000076e140000, 0x000000076e140000)

What is the meaning of these memory addresses?

I have searched the web but am unable to find any explanation of this part of the GC logs.

like image 513
DontDivideByZero Avatar asked Feb 05 '15 12:02

DontDivideByZero


1 Answers

A (bottom) - lower address of the reserved memory region;
B (top) - current pointer to the top of the allocated area;
C (end) - upper bound of the reserved memory region.

Here are the relevant references to the source code.

space.hpp:

// Size computations: sizes in bytes.
size_t capacity() const        { return byte_size(bottom(), end()); }
size_t used() const            { return byte_size(bottom(), top()); }
size_t free() const            { return byte_size(top(),    end()); }

space.cpp:

void ContiguousSpace::print_on(outputStream* st) const {
  print_short_on(st);
  st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
                bottom(), top(), end());
}
like image 98
apangin Avatar answered Oct 29 '22 18:10

apangin