8227041: runtime/memory/RunUnitTestsConcurrently.java has a memory leak
Reviewed-by: stefank, coleenp
This commit is contained in:
parent
03030e473c
commit
0fa1047733
@ -1588,71 +1588,6 @@ void ClassLoaderMetaspace::add_to_statistics(ClassLoaderMetaspaceStatistics* out
|
||||
|
||||
/////////////// Unit tests ///////////////
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
class TestMetaspaceUtilsTest : AllStatic {
|
||||
public:
|
||||
static void test_reserved() {
|
||||
size_t reserved = MetaspaceUtils::reserved_bytes();
|
||||
|
||||
assert(reserved > 0, "assert");
|
||||
|
||||
size_t committed = MetaspaceUtils::committed_bytes();
|
||||
assert(committed <= reserved, "assert");
|
||||
|
||||
size_t reserved_metadata = MetaspaceUtils::reserved_bytes(Metaspace::NonClassType);
|
||||
assert(reserved_metadata > 0, "assert");
|
||||
assert(reserved_metadata <= reserved, "assert");
|
||||
|
||||
if (UseCompressedClassPointers) {
|
||||
size_t reserved_class = MetaspaceUtils::reserved_bytes(Metaspace::ClassType);
|
||||
assert(reserved_class > 0, "assert");
|
||||
assert(reserved_class < reserved, "assert");
|
||||
}
|
||||
}
|
||||
|
||||
static void test_committed() {
|
||||
size_t committed = MetaspaceUtils::committed_bytes();
|
||||
|
||||
assert(committed > 0, "assert");
|
||||
|
||||
size_t reserved = MetaspaceUtils::reserved_bytes();
|
||||
assert(committed <= reserved, "assert");
|
||||
|
||||
size_t committed_metadata = MetaspaceUtils::committed_bytes(Metaspace::NonClassType);
|
||||
assert(committed_metadata > 0, "assert");
|
||||
assert(committed_metadata <= committed, "assert");
|
||||
|
||||
if (UseCompressedClassPointers) {
|
||||
size_t committed_class = MetaspaceUtils::committed_bytes(Metaspace::ClassType);
|
||||
assert(committed_class > 0, "assert");
|
||||
assert(committed_class < committed, "assert");
|
||||
}
|
||||
}
|
||||
|
||||
static void test_virtual_space_list_large_chunk() {
|
||||
VirtualSpaceList* vs_list = new VirtualSpaceList(os::vm_allocation_granularity());
|
||||
MutexLocker cl(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
|
||||
// A size larger than VirtualSpaceSize (256k) and add one page to make it _not_ be
|
||||
// vm_allocation_granularity aligned on Windows.
|
||||
size_t large_size = (size_t)(2*256*K + (os::vm_page_size()/BytesPerWord));
|
||||
large_size += (os::vm_page_size()/BytesPerWord);
|
||||
vs_list->get_new_chunk(large_size, 0);
|
||||
}
|
||||
|
||||
static void test() {
|
||||
test_reserved();
|
||||
test_committed();
|
||||
test_virtual_space_list_large_chunk();
|
||||
}
|
||||
};
|
||||
|
||||
void TestMetaspaceUtils_test() {
|
||||
TestMetaspaceUtilsTest::test();
|
||||
}
|
||||
|
||||
#endif // !PRODUCT
|
||||
|
||||
struct chunkmanager_statistics_t {
|
||||
int num_specialized_chunks;
|
||||
int num_small_chunks;
|
||||
|
@ -242,7 +242,6 @@ WB_END
|
||||
void TestReservedSpace_test();
|
||||
void TestReserveMemorySpecial_test();
|
||||
void TestVirtualSpace_test();
|
||||
void TestMetaspaceUtils_test();
|
||||
#endif
|
||||
|
||||
WB_ENTRY(void, WB_RunMemoryUnitTests(JNIEnv* env, jobject o))
|
||||
@ -250,7 +249,6 @@ WB_ENTRY(void, WB_RunMemoryUnitTests(JNIEnv* env, jobject o))
|
||||
TestReservedSpace_test();
|
||||
TestReserveMemorySpecial_test();
|
||||
TestVirtualSpace_test();
|
||||
TestMetaspaceUtils_test();
|
||||
#endif
|
||||
WB_END
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user