Mercurial > hg > graal-compiler
diff 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 |
line wrap: on
line diff
--- a/src/share/vm/memory/metaspaceShared.hpp Thu Aug 28 17:05:41 2014 +0200 +++ b/src/share/vm/memory/metaspaceShared.hpp Mon Aug 25 00:13:36 2014 -0700 @@ -30,6 +30,19 @@ #include "utilities/exceptions.hpp" #include "utilities/macros.hpp" +#define LargeSharedArchiveSize (300*M) +#define HugeSharedArchiveSize (800*M) +#define ReadOnlyRegionPercentage 0.4 +#define ReadWriteRegionPercentage 0.55 +#define MiscDataRegionPercentage 0.03 +#define MiscCodeRegionPercentage 0.02 +#define LargeThresholdClassCount 5000 +#define HugeThresholdClassCount 40000 + +#define SET_ESTIMATED_SIZE(type, region) \ + Shared ##region## Size = FLAG_IS_DEFAULT(Shared ##region## Size) ? \ + (type ## SharedArchiveSize * region ## RegionPercentage) : Shared ## region ## Size + class FileMapInfo; // Class Data Sharing Support @@ -112,5 +125,8 @@ static void link_one_shared_class(Klass* obj, TRAPS); static void check_one_shared_class(Klass* obj); static void link_and_cleanup_shared_classes(TRAPS); + + static int count_class(const char* classlist_file); + static void estimate_regions_size() NOT_CDS_RETURN; }; #endif // SHARE_VM_MEMORY_METASPACE_SHARED_HPP