@@ -217,7 +217,7 @@ bool os::is_containerized() {
217217 return OSContainer::is_containerized ();
218218}
219219
220- bool os::container_memory_limit (physical_memory_size_type& value) {
220+ bool os::Container::memory_limit (physical_memory_size_type& value) {
221221 assert (is_containerized (), " must be running containerized" );
222222 jlong mem_limit = OSContainer::memory_limit_in_bytes ();
223223 if (mem_limit <= 0 ) {
@@ -227,7 +227,7 @@ bool os::container_memory_limit(physical_memory_size_type& value) {
227227 value = static_cast <physical_memory_size_type>(mem_limit);
228228 return true ;
229229}
230- bool os::container_memory_soft_limit (physical_memory_size_type& value) {
230+ bool os::Container::memory_soft_limit (physical_memory_size_type& value) {
231231 assert (is_containerized (), " must be running containerized" );
232232 jlong mem_limit = OSContainer::memory_soft_limit_in_bytes ();
233233 if (mem_limit <= 0 ) {
@@ -238,7 +238,7 @@ bool os::container_memory_soft_limit(physical_memory_size_type& value) {
238238 return true ;
239239}
240240
241- bool os::container_memory_throttle_limit (physical_memory_size_type& value) {
241+ bool os::Container::memory_throttle_limit (physical_memory_size_type& value) {
242242 assert (is_containerized (), " must be running containerized" );
243243 jlong mem_limit = OSContainer::memory_throttle_limit_in_bytes ();
244244 if (mem_limit <= 0 ) {
@@ -249,7 +249,7 @@ bool os::container_memory_throttle_limit(physical_memory_size_type& value) {
249249 return true ;
250250}
251251
252- bool os::container_used_memory (physical_memory_size_type& value) {
252+ bool os::Container::used_memory (physical_memory_size_type& value) {
253253 assert (is_containerized (), " must be running containerized" );
254254 jlong mem_usage = OSContainer::memory_usage_in_bytes ();
255255 if (mem_usage <= 0 ) {
@@ -261,19 +261,19 @@ bool os::container_used_memory(physical_memory_size_type& value) {
261261}
262262
263263bool os::available_memory (physical_memory_size_type& value) {
264- if (is_containerized () && container_available_memory (value)) {
264+ if (is_containerized () && Container::available_memory (value)) {
265265 log_trace (os)(" available container memory: " PHYS_MEM_TYPE_FORMAT, value);
266266 return true ;
267267 }
268268
269- return machine_available_memory (value);
269+ return Machine::available_memory (value);
270270}
271271
272- bool os::machine_available_memory (physical_memory_size_type& value) {
272+ bool os::Machine::available_memory (physical_memory_size_type& value) {
273273 return Linux::available_memory (value);
274274}
275275
276- bool os::container_available_memory (physical_memory_size_type& value) {
276+ bool os::Container::available_memory (physical_memory_size_type& value) {
277277 assert (is_containerized (), " must be running containerized" );
278278 julong avail_mem = 0 ;
279279 if (OSContainer::available_memory_in_container (avail_mem)) {
@@ -310,15 +310,15 @@ bool os::Linux::available_memory(physical_memory_size_type& value) {
310310}
311311
312312bool os::free_memory (physical_memory_size_type& value) {
313- if (is_containerized () && container_available_memory (value)) {
313+ if (is_containerized () && Container::available_memory (value)) {
314314 log_trace (os)(" free container memory: " PHYS_MEM_TYPE_FORMAT, value);
315315 return true ;
316316 }
317317
318- return machine_free_memory (value);
318+ return Machine::free_memory (value);
319319}
320320
321- bool os::machine_free_memory (physical_memory_size_type& value) {
321+ bool os::Machine::free_memory (physical_memory_size_type& value) {
322322 return Linux::free_memory (value);
323323}
324324
@@ -337,13 +337,13 @@ bool os::Linux::free_memory(physical_memory_size_type& value) {
337337}
338338
339339bool os::total_swap_space (physical_memory_size_type& value) {
340- if (is_containerized () && container_total_swap_space (value)) {
340+ if (is_containerized () && Container::total_swap_space (value)) {
341341 return true ;
342342 } // fallback to the host swap space if the container value fails
343- return machine_total_swap_space (value);
343+ return Machine::total_swap_space (value);
344344}
345345
346- bool os::machine_total_swap_space (physical_memory_size_type& value) {
346+ bool os::Machine::total_swap_space (physical_memory_size_type& value) {
347347 struct sysinfo si;
348348 int ret = sysinfo (&si);
349349 if (ret != 0 ) {
@@ -354,7 +354,7 @@ bool os::machine_total_swap_space(physical_memory_size_type& value) {
354354 return true ;
355355}
356356
357- bool os::container_total_swap_space (physical_memory_size_type& value) {
357+ bool os::Container::total_swap_space (physical_memory_size_type& value) {
358358 assert (is_containerized (), " must be running containerized" );
359359 jlong memory_and_swap_limit_in_bytes = OSContainer::memory_and_swap_limit_in_bytes ();
360360 jlong memory_limit_in_bytes = OSContainer::memory_limit_in_bytes ();
@@ -386,7 +386,7 @@ bool os::free_swap_space(physical_memory_size_type& value) {
386386 }
387387 size_t host_free_swap_val = MIN2 (total_swap_space, host_free_swap);
388388 if (is_containerized ()) {
389- if (container_free_swap_space (value)) {
389+ if (Container::free_swap_space (value)) {
390390 return true ;
391391 } else {
392392 // unlimited or not supported. Fall through to return host value
@@ -401,11 +401,11 @@ bool os::free_swap_space(physical_memory_size_type& value) {
401401 return true ;
402402}
403403
404- bool os::machine_free_swap_space (physical_memory_size_type& value) {
404+ bool os::Machine::free_swap_space (physical_memory_size_type& value) {
405405 return host_free_swap_f (value);
406406}
407407
408- bool os::container_free_swap_space (physical_memory_size_type& value) {
408+ bool os::Container::free_swap_space (physical_memory_size_type& value) {
409409 assert (is_containerized (), " must be running containerized" );
410410 jlong mem_swap_limit = OSContainer::memory_and_swap_limit_in_bytes ();
411411 jlong mem_limit = OSContainer::memory_limit_in_bytes ();
@@ -432,18 +432,18 @@ bool os::container_free_swap_space(physical_memory_size_type& value) {
432432physical_memory_size_type os::physical_memory () {
433433 if (is_containerized ()) {
434434 physical_memory_size_type mem_limit;
435- if (container_memory_limit (mem_limit)) {
435+ if (Container::memory_limit (mem_limit)) {
436436 log_trace (os)(" total container memory: " PHYS_MEM_TYPE_FORMAT, mem_limit);
437437 return mem_limit;
438438 }
439439 }
440440
441- physical_memory_size_type phys_mem = machine_physical_memory ();
441+ physical_memory_size_type phys_mem = Machine::physical_memory ();
442442 log_trace (os)(" total system memory: " PHYS_MEM_TYPE_FORMAT, phys_mem);
443443 return phys_mem;
444444}
445445
446- physical_memory_size_type os::machine_physical_memory () {
446+ physical_memory_size_type os::Machine::physical_memory () {
447447 return Linux::physical_memory ();
448448}
449449
@@ -4751,22 +4751,22 @@ int os::active_processor_count() {
47514751 }
47524752
47534753 if (is_containerized ()) {
4754- double cpu_quota = container_processor_count ();
4754+ double cpu_quota = Container::processor_count ();
47554755 int active_cpus = ceilf (cpu_quota); // Round fractional CPU quota up.
4756- assert (active_cpus <= machine_active_processor_count (), " must be" );
4756+ assert (active_cpus <= Machine::active_processor_count (), " must be" );
47574757 log_trace (os)(" active_processor_count: determined by OSContainer: %d" ,
47584758 active_cpus);
47594759 return active_cpus;
47604760 }
47614761
4762- return machine_active_processor_count ();
4762+ return Machine::active_processor_count ();
47634763}
47644764
4765- int os::machine_active_processor_count () {
4765+ int os::Machine::active_processor_count () {
47664766 return os::Linux::active_processor_count ();
47674767}
47684768
4769- double os::container_processor_count () {
4769+ double os::Container::processor_count () {
47704770 assert (is_containerized (), " must be running containerized" );
47714771 return OSContainer::active_processor_count ();
47724772}
0 commit comments