runtime/memory/RunUnitTestsConcurrently.java attempts to stress-test the metaspace allocator by allocating a metachunk of ~512K:
metaspace.cpp:
static void test_virtual_space_list_large_chunk() {
....
vs_list->get_new_chunk(large_size, 0);
}
That chunk then is leaked.
Within RunUnitTestsConcurrently.java, this function is called in a tight loop by 30 threads concurrently for 15 seconds. Depending on how fast the machine is, this will usually eat up 10-20GB, often causing the process being OOM killed.
This is probably also the cause for JDK-8225200.