comparison src/share/vm/memory/metaspaceShared.hpp @ 20389:622c6e0ad4d6

8048150: Allow easy configurations for large CDS archives Summary: Estimate the size of shared archive based on the number of classes in the classlist file Reviewed-by: iklam, jiangli, minqi, dholmes
author ccheung
date Mon, 25 Aug 2014 00:13:36 -0700
parents 6e0cb14ce59b
children b23a19cd0536
comparison
equal deleted inserted replaced
20386:edb5f3b38aab 20389:622c6e0ad4d6
27 #include "memory/allocation.hpp" 27 #include "memory/allocation.hpp"
28 #include "memory/memRegion.hpp" 28 #include "memory/memRegion.hpp"
29 #include "runtime/virtualspace.hpp" 29 #include "runtime/virtualspace.hpp"
30 #include "utilities/exceptions.hpp" 30 #include "utilities/exceptions.hpp"
31 #include "utilities/macros.hpp" 31 #include "utilities/macros.hpp"
32
33 #define LargeSharedArchiveSize (300*M)
34 #define HugeSharedArchiveSize (800*M)
35 #define ReadOnlyRegionPercentage 0.4
36 #define ReadWriteRegionPercentage 0.55
37 #define MiscDataRegionPercentage 0.03
38 #define MiscCodeRegionPercentage 0.02
39 #define LargeThresholdClassCount 5000
40 #define HugeThresholdClassCount 40000
41
42 #define SET_ESTIMATED_SIZE(type, region) \
43 Shared ##region## Size = FLAG_IS_DEFAULT(Shared ##region## Size) ? \
44 (type ## SharedArchiveSize * region ## RegionPercentage) : Shared ## region ## Size
32 45
33 class FileMapInfo; 46 class FileMapInfo;
34 47
35 // Class Data Sharing Support 48 // Class Data Sharing Support
36 class MetaspaceShared : AllStatic { 49 class MetaspaceShared : AllStatic {
110 123
111 static bool try_link_class(InstanceKlass* ik, TRAPS); 124 static bool try_link_class(InstanceKlass* ik, TRAPS);
112 static void link_one_shared_class(Klass* obj, TRAPS); 125 static void link_one_shared_class(Klass* obj, TRAPS);
113 static void check_one_shared_class(Klass* obj); 126 static void check_one_shared_class(Klass* obj);
114 static void link_and_cleanup_shared_classes(TRAPS); 127 static void link_and_cleanup_shared_classes(TRAPS);
128
129 static int count_class(const char* classlist_file);
130 static void estimate_regions_size() NOT_CDS_RETURN;
115 }; 131 };
116 #endif // SHARE_VM_MEMORY_METASPACE_SHARED_HPP 132 #endif // SHARE_VM_MEMORY_METASPACE_SHARED_HPP