22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "gc/shared/gcInitLogger.hpp"
27 #include "logging/log.hpp"
28 #include "oops/compressedOops.hpp"
29 #include "runtime/globals.hpp"
30 #include "runtime/vm_version.hpp"
31 #include "utilities/globalDefinitions.hpp"
32
33 void GCInitLogger::print_all() {
34 print_version();
35 print_cpu();
36 print_memory();
37 print_large_pages();
38 print_numa();
39 print_compressed_oops();
40 print_heap();
41 print_workers();
42 }
43
44 void GCInitLogger::print() {
45 GCInitLogger init_log;
46 init_log.print_all();
47 }
48
49 void GCInitLogger::print_version() {
50 log_info(gc, init)("Version: %s (%s)",
51 VM_Version::vm_release(),
52 VM_Version::jdk_debug_level());
53 }
54
55 void GCInitLogger::print_cpu() {
56 log_info(gc, init)("CPUs: %u total, %u available",
57 os::processor_count(),
58 os::initial_active_processor_count());
59 }
60
61 void GCInitLogger::print_memory() {
87 }
88
89 void GCInitLogger::print_heap() {
90 log_info(gc, init)("Heap Min Capacity: " SIZE_FORMAT "%s",
91 byte_size_in_exact_unit(MinHeapSize), exact_unit_for_byte_size(MinHeapSize));
92 log_info(gc, init)("Heap Initial Capacity: " SIZE_FORMAT "%s",
93 byte_size_in_exact_unit(InitialHeapSize), exact_unit_for_byte_size(InitialHeapSize));
94 log_info(gc, init)("Heap Max Capacity: " SIZE_FORMAT "%s",
95 byte_size_in_exact_unit(MaxHeapSize), exact_unit_for_byte_size(MaxHeapSize));
96
97 log_info(gc, init)("Pre-touch: %s", AlwaysPreTouch ? "Enabled" : "Disabled");
98 }
99
100 void GCInitLogger::print_workers() {
101 if (ParallelGCThreads > 0) {
102 log_info(gc, init)("Parallel Workers: %u", ParallelGCThreads);
103 }
104 if (ConcGCThreads > 0) {
105 log_info(gc, init)("Concurrent Workers: %u", ConcGCThreads);
106 }
107 }
108
109 const char* GCInitLogger::large_pages_support() {
110 if (UseLargePages) {
111 #ifdef LINUX
112 if (UseTransparentHugePages) {
113 return "Enabled (Transparent)";
114 } else {
115 return "Enabled (Explicit)";
116 }
117 #else
118 return "Enabled";
119 #endif
120 } else {
121 return "Disabled";
122 }
123 }
|
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "gc/shared/gcInitLogger.hpp"
27 #include "logging/log.hpp"
28 #include "oops/compressedOops.hpp"
29 #include "runtime/globals.hpp"
30 #include "runtime/vm_version.hpp"
31 #include "utilities/globalDefinitions.hpp"
32
33 void GCInitLogger::print_all() {
34 print_version();
35 print_cpu();
36 print_memory();
37 print_large_pages();
38 print_numa();
39 print_compressed_oops();
40 print_heap();
41 print_workers();
42 print_gc_specific();
43 }
44
45 void GCInitLogger::print() {
46 GCInitLogger init_log;
47 init_log.print_all();
48 }
49
50 void GCInitLogger::print_version() {
51 log_info(gc, init)("Version: %s (%s)",
52 VM_Version::vm_release(),
53 VM_Version::jdk_debug_level());
54 }
55
56 void GCInitLogger::print_cpu() {
57 log_info(gc, init)("CPUs: %u total, %u available",
58 os::processor_count(),
59 os::initial_active_processor_count());
60 }
61
62 void GCInitLogger::print_memory() {
88 }
89
90 void GCInitLogger::print_heap() {
91 log_info(gc, init)("Heap Min Capacity: " SIZE_FORMAT "%s",
92 byte_size_in_exact_unit(MinHeapSize), exact_unit_for_byte_size(MinHeapSize));
93 log_info(gc, init)("Heap Initial Capacity: " SIZE_FORMAT "%s",
94 byte_size_in_exact_unit(InitialHeapSize), exact_unit_for_byte_size(InitialHeapSize));
95 log_info(gc, init)("Heap Max Capacity: " SIZE_FORMAT "%s",
96 byte_size_in_exact_unit(MaxHeapSize), exact_unit_for_byte_size(MaxHeapSize));
97
98 log_info(gc, init)("Pre-touch: %s", AlwaysPreTouch ? "Enabled" : "Disabled");
99 }
100
101 void GCInitLogger::print_workers() {
102 if (ParallelGCThreads > 0) {
103 log_info(gc, init)("Parallel Workers: %u", ParallelGCThreads);
104 }
105 if (ConcGCThreads > 0) {
106 log_info(gc, init)("Concurrent Workers: %u", ConcGCThreads);
107 }
108 }
109
110 void GCInitLogger::print_gc_specific() {
111 // To allow additional gc specific logging.
112 }
113
114 const char* GCInitLogger::large_pages_support() {
115 if (UseLargePages) {
116 #ifdef LINUX
117 if (UseTransparentHugePages) {
118 return "Enabled (Transparent)";
119 } else {
120 return "Enabled (Explicit)";
121 }
122 #else
123 return "Enabled";
124 #endif
125 } else {
126 return "Disabled";
127 }
128 }
|